On 12/01/09 13:40, Gerd Hoffmann wrote:

+ return oom_check(malloc(size ? size : 1));

void *qemu_realloc(void *ptr, size_t size)
{
+ return oom_check(realloc(ptr, size ? size : 1));

qemu_realloc(qemu_malloc(0), 42);

should better work correctly ...

Oops, scratch that.

"return malloc(size ? size : 1)" is very different from "return size ? malloc(size) : 1" which my mind somehow made out of the code line above ...

sorry,
  Gerd



Reply via email to