mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-30 02:50:25 +08:00
* 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>
|
||||
|
||||
* dllfixdbg: Eliminate extra objcopy step.
|
||||
|
@ -232,8 +232,11 @@ _crealloc (void *ptr, unsigned size)
|
||||
if (size <= oldsize)
|
||||
return ptr;
|
||||
newptr = _cmalloc (size);
|
||||
memcpy (newptr, ptr, oldsize);
|
||||
_cfree (ptr);
|
||||
if (newptr)
|
||||
{
|
||||
memcpy (newptr, ptr, oldsize);
|
||||
_cfree (ptr);
|
||||
}
|
||||
}
|
||||
return newptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user