mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
[DESK]
Fix memory & resource leaks svn path=/trunk/; revision=53924
This commit is contained in:
parent
30b66be3ad
commit
e950f52e39
1 changed files with 5 additions and 0 deletions
|
@ -38,11 +38,15 @@ DibLoadImage(LPTSTR lpFilename)
|
|||
|
||||
lpBitmap = HeapAlloc(GetProcessHeap(), 0, sizeof(DIBITMAP));
|
||||
if (lpBitmap == NULL)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lpBitmap->header = HeapAlloc(GetProcessHeap(), 0, dwFileSize);
|
||||
if (lpBitmap->header == NULL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpBitmap);
|
||||
CloseHandle(hFile);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -56,6 +60,7 @@ DibLoadImage(LPTSTR lpFilename)
|
|||
(lpBitmap->header->bfSize != dwFileSize))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpBitmap->header);
|
||||
HeapFree(GetProcessHeap(), 0, lpBitmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue