[PATCH] gdiplus: free dash_pattern_scaled (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jul 15 06:50:58 CDT 2017


1414713 Resource leak

Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
---
 dlls/gdiplus/graphicspath.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 458019fd64..b19efb1b32 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -2109,7 +2109,10 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
         dash_pattern_scaled[i] = pen->width * dash_pattern[i];
 
     tmp_points = heap_alloc_zero((end - start + 2) * sizeof(GpPoint));
-    if (!tmp_points) return; /* FIXME */
+    if (!tmp_points) { 
+        heap_free(dash_pattern_scaled);
+        return; /* FIXME */
+    }
 
     if (!closed)
         draw_start_cap = 1;
@@ -2186,7 +2189,7 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
             draw_start_cap ? pen->startcap : LineCapFlat, pen->customstart,
             closed ? LineCapFlat : pen->endcap, pen->customend, last_point);
     }
-
+    heap_free(dash_pattern_scaled);
     heap_free(tmp_points);
 }
 
-- 
2.13.2




More information about the wine-patches mailing list