Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mpatch.c @ 2048:8f9660c568b8
Set correct exception for another possible malloc error in mpatch.c
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 05 Apr 2006 15:39:48 +0200 |
parents | 10606ee61107 |
children | 345107e167a0 |
line wrap: on
line diff
--- a/mercurial/mpatch.c Tue Apr 04 16:35:20 2006 -0700 +++ b/mercurial/mpatch.c Wed Apr 05 15:39:48 2006 +0200 @@ -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();