[PATCH] comctl32: free the selection RANGES (Coverity)

Marcus Meissner meissner at suse.de
Mon Jan 7 15:17:39 CST 2013


CID 713344

selection is not freed in the two exit paths.

Ciao, Marcus
---
 dlls/comctl32/listview.c |   10 ++++++++--
 1 Datei geändert, 8 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 3076249..2c953ad 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3594,9 +3594,15 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
 	POINT ptItem;
 	
 	rcItem.left = LVIR_BOUNDS;
-	if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) return;
+	if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) {
+	     ranges_destroy (selection);
+	     return;
+	}
 	rcSelMark.left = LVIR_BOUNDS;
-	if (!LISTVIEW_GetItemRect(infoPtr, infoPtr->nSelectionMark, &rcSelMark)) return;
+	if (!LISTVIEW_GetItemRect(infoPtr, infoPtr->nSelectionMark, &rcSelMark)) {
+	     ranges_destroy (selection);
+	     return;
+	}
 	UnionRect(&rcSel, &rcItem, &rcSelMark);
 	iterator_frameditems(&i, infoPtr, &rcSel);
 	while(iterator_next(&i))
-- 
1.7.10.4




More information about the wine-patches mailing list