* cygheap.cc (_crealloc): Avoid memcpy when _cmalloc returns NULL.
This commit is contained in:
parent
2194c4db86
commit
32cba6cb3a
|
@ -1,3 +1,7 @@
|
||||||
|
2007-11-23 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
|
* cygheap.cc (_crealloc): Avoid memcpy when _cmalloc returns NULL.
|
||||||
|
|
||||||
2007-11-08 Christopher Faylor <me+cygwin@cgf.cx>
|
2007-11-08 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
* dllfixdbg: Eliminate extra objcopy step.
|
* dllfixdbg: Eliminate extra objcopy step.
|
||||||
|
|
|
@ -232,8 +232,11 @@ _crealloc (void *ptr, unsigned size)
|
||||||
if (size <= oldsize)
|
if (size <= oldsize)
|
||||||
return ptr;
|
return ptr;
|
||||||
newptr = _cmalloc (size);
|
newptr = _cmalloc (size);
|
||||||
memcpy (newptr, ptr, oldsize);
|
if (newptr)
|
||||||
_cfree (ptr);
|
{
|
||||||
|
memcpy (newptr, ptr, oldsize);
|
||||||
|
_cfree (ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return newptr;
|
return newptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue