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

Alexandre Julliard julliard at winehq.org
Mon Jun 4 16:26:23 CDT 2018


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

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>

---

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

diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 41cab60..49e270c 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