Commit c43fdb75 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

GlobalReAlloc returns 0 on failure.

parent e529d360
...@@ -1251,14 +1251,17 @@ HGLOBAL WINAPI GlobalReAlloc( ...@@ -1251,14 +1251,17 @@ HGLOBAL WINAPI GlobalReAlloc(
hnew=hmem; hnew=hmem;
if(pintern->Pointer) if(pintern->Pointer)
{ {
palloc=HeapReAlloc(heap, heap_flags, if((palloc = HeapReAlloc(heap, heap_flags,
(char *) pintern->Pointer-sizeof(HGLOBAL), (char *) pintern->Pointer-sizeof(HGLOBAL),
size+sizeof(HGLOBAL) ); size+sizeof(HGLOBAL))) == NULL)
return 0; /* Block still valid */
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL); pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
} }
else else
{ {
palloc=HeapAlloc(heap, heap_flags, size+sizeof(HGLOBAL)); if((palloc=HeapAlloc(heap, heap_flags, size+sizeof(HGLOBAL)))
== NULL)
return 0;
*(HGLOBAL *)palloc=hmem; *(HGLOBAL *)palloc=hmem;
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL); pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
} }
......
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