mercurial/mpatch.c
changeset 3138 cc856c4d91ca
parent 2858 345bac2bc4ec
child 4073 95ffa36d1d2a
child 4375 11dc22eb8e8d
--- a/mercurial/mpatch.c
+++ b/mercurial/mpatch.c
@@ -62,6 +62,9 @@ static struct flist *lalloc(int size)
 {
 	struct flist *a = NULL;
 
+	if (size < 1)
+		size = 1;
+
 	a = (struct flist *)malloc(sizeof(struct flist));
 	if (a) {
 		a->base = (struct frag *)malloc(sizeof(struct frag) * size);