Commit 947c61e4 authored by Oleg Prokhorov's avatar Oleg Prokhorov Committed by Alexandre Julliard

Avoid HeapReAlloc of a NULL pointer.

parent 64ed084e
...@@ -824,11 +824,17 @@ struct ne_init_list ...@@ -824,11 +824,17 @@ struct ne_init_list
static void add_to_init_list( struct ne_init_list *list, NE_MODULE *hModule ) static void add_to_init_list( struct ne_init_list *list, NE_MODULE *hModule )
{ {
NE_MODULE **newModule = NULL;
if ( list->count == list->size ) if ( list->count == list->size )
{ {
int newSize = list->size + 128; int newSize = list->size + 128;
NE_MODULE **newModule = HeapReAlloc( GetProcessHeap(), 0,
if (list->module)
newModule = HeapReAlloc( GetProcessHeap(), 0,
list->module, newSize*sizeof(NE_MODULE *) ); list->module, newSize*sizeof(NE_MODULE *) );
else
newModule = HeapAlloc( GetProcessHeap(), 0,
newSize*sizeof(NE_MODULE *) );
if ( !newModule ) if ( !newModule )
{ {
FIXME_(dll)("Out of memory!"); FIXME_(dll)("Out of memory!");
......
...@@ -665,9 +665,13 @@ void VGA_PrepareVideoMemCopy(unsigned Xres, unsigned Yres) ...@@ -665,9 +665,13 @@ void VGA_PrepareVideoMemCopy(unsigned Xres, unsigned Yres)
/* /*
* Allocate space for char + attr. * Allocate space for char + attr.
*/ */
vga_text_old = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
vga_text_old, Xres * Yres * 2 );
if (vga_text_old)
vga_text_old = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
vga_text_old, Xres * Yres * 2 );
else
vga_text_old = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
Xres * Yres * 2 );
p = VGA_AlphaBuffer(); p = VGA_AlphaBuffer();
p2 = vga_text_old; p2 = vga_text_old;
......
...@@ -723,7 +723,12 @@ static BOOL DIR_SearchSemicolonedPaths(LPCWSTR name, DOS_FULL_NAME *full_name, L ...@@ -723,7 +723,12 @@ static BOOL DIR_SearchSemicolonedPaths(LPCWSTR name, DOS_FULL_NAME *full_name, L
if (newlen > currlen) if (newlen > currlen)
{ {
if (!(buffer = HeapReAlloc( GetProcessHeap(), 0, buffer, newlen * sizeof(WCHAR)))) if (buffer)
buffer = HeapReAlloc( GetProcessHeap(), 0, buffer, newlen * sizeof(WCHAR));
else
buffer = HeapAlloc( GetProcessHeap(), 0, newlen * sizeof(WCHAR));
if(!buffer)
goto done; goto done;
currlen = newlen; currlen = newlen;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment