Nikolay Sivov : comctl32/listview: Handle DPA_SetPtr() failure (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 8 11:18:23 CDT 2016


Module: wine
Branch: master
Commit: f5ca9b91046f43410934ddf872bf4504cd9e9fe1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f5ca9b91046f43410934ddf872bf4504cd9e9fe1

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Apr  8 16:56:40 2016 +0300

comctl32/listview: Handle DPA_SetPtr() failure (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;
     




More information about the wine-cvs mailing list