Author: gedmurphy
Date: Thu Jun 1 02:39:51 2006
New Revision: 22136
URL:
http://svn.reactos.ru/svn/reactos?rev=22136&view=rev
Log:
fix possible memory leak
Modified:
trunk/reactos/base/applications/screenshot/screenshot.c
Modified: trunk/reactos/base/applications/screenshot/screenshot.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
==============================================================================
--- trunk/reactos/base/applications/screenshot/screenshot.c (original)
+++ trunk/reactos/base/applications/screenshot/screenshot.c Thu Jun 1 02:39:51 2006
@@ -347,6 +347,8 @@
pScrSht = HeapAlloc(GetProcessHeap(),
0,
sizeof(SCREENSHOT));
+ if (pScrSht == NULL)
+ return -1;
if (bFullScreen)
{
@@ -358,7 +360,13 @@
}
if (pScrSht->hSelf == NULL)
+ {
+ HeapFree(GetProcessHeap(),
+ 0,
+ pScrSht);
+
return -1;
+ }
if (CaptureScreen(pScrSht))
{