Michael Stefaniuc : user32: Simplify the error handling in BITMAP_Load().
Alexandre Julliard
julliard at winehq.org
Thu Dec 2 16:30:50 CST 2010
Module: wine
Branch: stable
Commit: 6be61d1c2d3d6f1f270ccd7985aca0087dac6629
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6be61d1c2d3d6f1f270ccd7985aca0087dac6629
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Tue Sep 28 22:45:21 2010 +0200
user32: Simplify the error handling in BITMAP_Load().
This fixes a memleak on an error path (Smatch).
(cherry picked from commit 5a2cc9410586b32aacdb9a878686b68d96e941ab)
---
dlls/user32/cursoricon.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index acae302..6b0e0f9 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -2239,7 +2239,7 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name,
if (bmfh->bfType != 0x4d42 /* 'BM' */)
{
WARN("Invalid/unsupported bitmap format!\n");
- goto end_close;
+ goto end;
}
if (bmfh->bfOffBits) offbits = bmfh->bfOffBits - sizeof(BITMAPFILEHEADER);
}
@@ -2260,7 +2260,7 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name,
if (bm_type == -1)
{
WARN("Invalid bitmap format!\n");
- goto end_close;
+ goto end;
}
if(desiredx != 0)
@@ -2319,7 +2319,6 @@ end:
if (screen_mem_dc) DeleteDC(screen_mem_dc);
HeapFree(GetProcessHeap(), 0, scaled_info);
HeapFree(GetProcessHeap(), 0, fix_info);
-end_close:
if (loadflags & LR_LOADFROMFILE) UnmapViewOfFile( ptr );
return hbitmap;
More information about the wine-cvs
mailing list