Alex Henrie : gdi32: Fix memory leak on error in PATH_WidenPath (Coverity) .

Alexandre Julliard julliard at winehq.org
Thu Sep 13 03:49:17 CDT 2018


Module: wine
Branch: stable
Commit: 47911f80251b002e2fd3f76fc1248cdb3f2e7531
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=47911f80251b002e2fd3f76fc1248cdb3f2e7531

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Fri Jun  1 07:15:44 2018 -0600

gdi32: Fix memory leak on error in PATH_WidenPath (Coverity).

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 7c57461d299620f2e0fa3b9f02bdbe910de41e75)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/gdi32/path.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 51334b2..04fa678 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -1749,6 +1749,9 @@ static struct gdi_path *PATH_WidenPath(DC *dc)
                 break;
             default:
                 ERR("Got path flag %c\n", flat_path->flags[i]);
+                for(i = 0; i < numStrokes; i++) free_gdi_path(pStrokes[i]);
+                HeapFree(GetProcessHeap(), 0, pStrokes);
+                free_gdi_path(flat_path);
                 return NULL;
         }
     }




More information about the wine-cvs mailing list