# HG changeset patch # User Thomas Arendsen Hein # Date 1144244388 -7200 # Node ID 8f9660c568b8ec7d9c851bb9cd25a6278278719b # Parent ebf1ecb5f4e83516697ffece97b3600d7274aece Set correct exception for another possible malloc error in mpatch.c diff -r ebf1ecb5f4e8 -r 8f9660c568b8 mercurial/mpatch.c --- 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();