gdiplus: do not call delete_element(NULL) (try 2)

Vincent Povirk madewokherd+8cd9 at gmail.com
Sat Jan 24 00:48:49 CST 2009


In several cases we call delete_element(x) after x has been set to
NULL or after an unsuccessful clone_element(y, &x) call. clone_element
always gives a NULL element pointer when it fails.
delete_element(NULL) will dereference the NULL and crash. These lines
will never be reached with a non-NULL element.

Vincent Povirk
-------------- next part --------------
From 4f07e4694d5be28af5e0f3cd933eabc8cf08bf61 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <madewokherd at gmail.com>
Date: Sat, 24 Jan 2009 00:30:50 -0600
Subject: [PATCH] gdiplus: do not call delete_element(NULL)

---
 dlls/gdiplus/region.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index 4d694f4..89b107f 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -268,7 +268,6 @@ GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, Combin
 
 out:
     GdipFree(left);
-    delete_element(right);
     GdipDeleteRegion(path_region);
     return stat;
 }
@@ -315,7 +314,6 @@ GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region,
 
 out:
     GdipFree(left);
-    delete_element(right);
     GdipDeleteRegion(rect_region);
     return stat;
 }
@@ -373,7 +371,6 @@ GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1,
     if (stat != Ok)
     {
         GdipFree(left);
-        delete_element(right);
         return OutOfMemory;
     }
 
-- 
1.5.4.3


More information about the wine-patches mailing list