X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d275c7eb8420c81e97a8b308c60c27d9856b58f9..2d956b58023a4955313a1c1531bc70a0deb0b831:/src/msw/dib.cpp?ds=sidebyside diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index f5b86d7c2b..5267d91587 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -659,7 +659,7 @@ HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo) npPal = (LPLOGPALETTE)malloc(sizeof(LOGPALETTE) + (WORD)lpInfo->biClrUsed * sizeof(PALETTEENTRY)); if (!npPal) - return(FALSE); + return NULL; npPal->palVersion = 0x300; npPal->palNumEntries = (WORD)lpInfo->biClrUsed; @@ -695,14 +695,15 @@ HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo) bool wxLoadIntoBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette **pal) { - HBITMAP hBitmap; - HPALETTE hPalette; + HBITMAP hBitmap = NULL; + HPALETTE hPalette = NULL; bool success = (wxReadDIB(filename, &hBitmap, &hPalette) != 0); if (!success) { - DeleteObject(hPalette); + if (hPalette) + DeleteObject(hPalette); return FALSE; }