From a645a2f83d79abfa78f0d967a35977c3cfef8cef Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 23 Apr 2015 18:25:19 +0200 Subject: [PATCH] lib9p: handle erealloc9p(..., 0) --- sys/src/lib9p/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/lib9p/mem.c b/sys/src/lib9p/mem.c index b4414951f..a19a4c9e3 100644 --- a/sys/src/lib9p/mem.c +++ b/sys/src/lib9p/mem.c @@ -24,7 +24,7 @@ erealloc9p(void *v, ulong sz) { void *nv; - if((nv = realloc(v, sz)) == nil) { + if((nv = realloc(v, sz)) == nil && sz != 0) { fprint(2, "out of memory allocating %lud\n", sz); exits("mem"); }