diff -r 856f0ba200bc -r 345107e167a0 mercurial/mpatch.c --- a/mercurial/mpatch.c Sat Apr 08 20:08:06 2006 -0400 +++ b/mercurial/mpatch.c Sat Apr 08 20:10:46 2006 -0400 @@ -61,12 +61,12 @@ a = (struct flist *)malloc(sizeof(struct flist)); if (a) { a->base = (struct frag *)malloc(sizeof(struct frag) * size); - if (!a->base) { - free(a); - a = NULL; - } else + if (a->base) { a->head = a->tail = a->base; - return a; + return a; + } + free(a); + a = NULL; } if (!PyErr_Occurred()) PyErr_NoMemory();