From fc753bbb5886443ab0126bc883fd231926d49b2f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sun, 28 Sep 2008 12:17:26 -0700 Subject: [PATCH] gdiplus: Free memory on a failure. --- dlls/gdiplus/brush.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index efa370fd09e..8bf09efb257 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -586,7 +586,11 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, abs(stride)); *texture = GdipAlloc(sizeof(GpTexture)); - if (!*texture) return OutOfMemory; + if (!*texture){ + GdipFree(dibits); + GdipFree(buff); + return OutOfMemory; + } if((status = GdipCreateMatrix(&(*texture)->transform)) != Ok){ GdipFree(*texture);