code: plan9front

Download patch

ref: 4e7efadf120c3357a251b6b2268ec6f3dfb1bd22
parent: c1ff805e236a818eb530ac68236c506448377419
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Apr 23 14:19:48 EDT 2015

hjfs: fix erealloc(..., 0) crash when removing member from group array makes it empty (thanks 9dan)

--- a/sys/src/cmd/hjfs/main.c
+++ b/sys/src/cmd/hjfs/main.c
@@ -31,7 +31,7 @@
 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;