From 2e9c3ff97c27ad35149e580ec7574661ec22bd55 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 12 Dec 2005 20:30:09 +0000 Subject: [PATCH] Check for failed allocations. Spotted by Martin Bealby. svn path=/trunk/; revision=20114 --- reactos/lib/user32/windows/icon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/lib/user32/windows/icon.c b/reactos/lib/user32/windows/icon.c index 03ce2f05d00..28d36ad9b55 100644 --- a/reactos/lib/user32/windows/icon.c +++ b/reactos/lib/user32/windows/icon.c @@ -260,6 +260,10 @@ CreateIconFromResourceEx( /* get an safe copy of the icon data */ SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, cbIconBits); + if (SafeIconImage == NULL) + { + return NULL; + } memcpy(SafeIconImage, pbIconBits, cbIconBits); /* take into acount the origonal height was for both the AND and XOR images */