Author: akhaldi
Date: Sat May 18 14:48:51 2013
New Revision: 59036
URL:
http://svn.reactos.org/svn/reactos?rev=59036&view=rev
Log:
[MSPAINT]
* Plug a handle leak. Fixed by Andre Guibert de Bruet.
CORE-7190 #resolve #comment Committed in r59036. Thanks !
Modified:
trunk/reactos/base/applications/mspaint/dib.c
Modified: trunk/reactos/base/applications/mspaint/dib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/dib.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/dib.c [iso-8859-1] Sat May 18 14:48:51 2013
@@ -131,7 +131,10 @@
bi = HeapAlloc(GetProcessHeap(), 0, bfh.bfOffBits - sizeof(BITMAPFILEHEADER));
if (!bi)
+ {
+ CloseHandle(hFile);
return;
+ }
ReadFile(hFile, bi, bfh.bfOffBits - sizeof(BITMAPFILEHEADER), &dwBytesRead,
NULL);
*hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0);