Fixed other instances of the xrealloc(0) bug.
diff --git a/programs/winetest/util.c b/programs/winetest/util.c index d09b90b..0365d53 100644 --- a/programs/winetest/util.c +++ b/programs/winetest/util.c
@@ -36,7 +36,7 @@ { void *p = realloc (op, len); - if (!p) report (R_FATAL, "Out of memory."); + if (len && !p) report (R_FATAL, "Out of memory."); return p; }
diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index ee404d5..6d5d31e 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c
@@ -60,8 +60,8 @@ void *xrealloc(void* p, size_t size) { - void* p2; - if ((p2 = realloc (p, size)) == NULL) + void* p2 = realloc (p, size); + if (size && !p2) error("Can not realloc %d bytes.", size); return p2;