From 4e7efadf120c3357a251b6b2268ec6f3dfb1bd22 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 23 Apr 2015 18:19:48 +0200 Subject: [PATCH] hjfs: fix erealloc(..., 0) crash when removing member from group array makes it empty (thanks 9dan) --- sys/src/cmd/hjfs/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/hjfs/main.c b/sys/src/cmd/hjfs/main.c index abf37c112..947032723 100644 --- a/sys/src/cmd/hjfs/main.c +++ b/sys/src/cmd/hjfs/main.c @@ -31,7 +31,7 @@ void* erealloc(void *v, int c) { v = realloc(v, c); - if(v == 0) + if(v == 0 && c != 0) sysfatal("realloc: %r"); setrealloctag(v, getcallerpc(&c)); return v;