mercurial/mpatch.c
changeset 282 97d83e7fbf2f
parent 128 d6afb6dbf9f2
child 384 a29decbf7475
--- a/mercurial/mpatch.c	Wed Jun 08 10:59:18 2005 -0800
+++ b/mercurial/mpatch.c	Wed Jun 08 11:01:18 2005 -0800
@@ -44,9 +44,10 @@
 	a = malloc(sizeof(struct flist));
 	if (a) {
 		a->base = malloc(sizeof(struct frag) * size);
-		if (!a->base)
+		if (!a->base) {
 			free(a);
-		else
+			a = NULL;
+		} else
 			a->head = a->tail = a->base;
 	}
 	return a;