[PATCH] comctl32/listview: Handle DPA_SetPtr() failure (Coverity)

Nikolay Sivov nsivov at codeweavers.com
Fri Apr 8 08:56:40 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/listview.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index b467b36..758b640 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3123,7 +3123,11 @@ static RANGES ranges_clone(RANGES ranges)
         RANGE *newrng = Alloc(sizeof(RANGE));
 	if (!newrng) goto fail;
 	*newrng = *((RANGE*)DPA_GetPtr(ranges->hdpa, i));
-	DPA_SetPtr(clone->hdpa, i, newrng);
+        if (!DPA_SetPtr(clone->hdpa, i, newrng))
+        {
+            Free(newrng);
+            goto fail;
+        }
     }
     return clone;
     
-- 
2.8.0.rc3




More information about the wine-patches mailing list