Sven Baars : gdi32: Fix a leak on error path (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Apr 19 15:38:10 CDT 2021


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

Author: Sven Baars <sbaars at codeweavers.com>
Date:   Sun Apr 18 14:30:25 2021 +0200

gdi32: Fix a leak on error path (Coverity).

Signed-off-by: Sven Baars <sbaars at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/path.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 618a050a139..a82b34908e1 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -1729,7 +1729,11 @@ static struct gdi_path *PATH_WidenPath(DC *dc)
                     pStrokes = HeapAlloc(GetProcessHeap(), 0, sizeof(*pStrokes));
                 else
                     pStrokes = HeapReAlloc(GetProcessHeap(), 0, pStrokes, numStrokes * sizeof(*pStrokes));
-                if(!pStrokes) return NULL;
+                if(!pStrokes)
+                {
+                    free_gdi_path(flat_path);
+                    return NULL;
+                }
                 pStrokes[numStrokes - 1] = alloc_gdi_path(0);
                 /* fall through */
             case PT_LINETO:




More information about the wine-cvs mailing list