goo/gmem.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit c7696a2604fd77bf0c1b2d31b75d2f97ab8e8b61 Author: Albert Astals Cid <[email protected]> Date: Thu Oct 28 00:37:29 2010 +0100 if reallocn fails, free p diff --git a/goo/gmem.cc b/goo/gmem.cc index af3e19e..453fce5 100644 --- a/goo/gmem.cc +++ b/goo/gmem.cc @@ -253,8 +253,12 @@ inline static void *greallocn(void *p, int nObjs, int objSize, bool checkoverflo throw GMemException(); #else fprintf(stderr, "Bogus memory allocation size\n"); - if (checkoverflow) return NULL; - else exit(1); + if (checkoverflow) { + gfree(p); + return NULL; + } else { + exit(1); + } #endif } return grealloc(p, n, checkoverflow); _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
