Author: mkupfer
Date: Fri Mar 26 21:27:21 2010
New Revision: 46476
URL:
http://svn.reactos.org/svn/reactos?rev=46476&view=rev
Log:
- two small fixes (freeing resources on error)
Modified:
trunk/reactos/dll/cpl/sysdm/general.c
Modified: trunk/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/general.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/general.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/general.c [iso-8859-1] Fri Mar 26 21:27:21 2010
@@ -96,7 +96,16 @@
// build new bitmap
GetObject(pImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
dc = CreateCompatibleDC(GetDC(NULL));
+ if (dc == NULL)
+ {
+ break;
+ }
sdc = CreateCompatibleDC(dc);
+ if (sdc == NULL)
+ {
+ DeleteDC(dc);
+ break;
+ }
ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm,
0);