[PATCH 3/4] gdi32: Fix a leak on error path (Coverity).
Sven Baars
sbaars at codeweavers.com
Sun Apr 18 07:30:25 CDT 2021
Signed-off-by: Sven Baars <sbaars at codeweavers.com>
---
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:
--
2.30.0.335.ge6362826a0
More information about the wine-devel
mailing list