bmp is leaked if fail to create hdc.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/gdiplus/graphics.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 76aabe74bf..894e879233 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1069,7 +1069,11 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush) { HDC hdc = CreateCompatibleDC(NULL);
- if (!hdc) break; + if (!hdc) + { + DeleteObject(bmp); + break; + }
SelectObject(hdc, bmp); gdi_alpha_blend(graphics, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,