Fix qemu_realloc() (Kevin Wolf)
For qemu_realloc with size == 0 a result of NULL is perfectly fine Signed-off-by: Kevin Wolf <kwolf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6615 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
9c22bc6312
commit
322691a5c9
@ -48,7 +48,10 @@ void *qemu_malloc(size_t size)
|
|||||||
|
|
||||||
void *qemu_realloc(void *ptr, size_t size)
|
void *qemu_realloc(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
return oom_check(realloc(ptr, size));
|
if (size)
|
||||||
|
return oom_check(realloc(ptr, size));
|
||||||
|
else
|
||||||
|
return realloc(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *qemu_mallocz(size_t size)
|
void *qemu_mallocz(size_t size)
|
||||||
|
Loading…
Reference in New Issue
Block a user