X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d275c7eb8420c81e97a8b308c60c27d9856b58f9..8b3fddc49326c0b6019cd7082218726aa17a5727:/src/msw/dib.cpp?ds=inline diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index f5b86d7c2b..c48d865d23 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -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; }