[poppler] goo/gmem.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Wed Oct 27 16:38:07 PDT 2010
goo/gmem.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 15b9aeac5a20c544db1aebe00113ebc2f7ba52c7
Author: Albert Astals Cid <aacid at kde.org>
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 ff0703b..3e9adb0 100644
--- a/goo/gmem.cc
+++ b/goo/gmem.cc
@@ -230,8 +230,12 @@ inline static void *greallocn(void *p, int nObjs, int objSize, bool checkoverflo
n = nObjs * objSize;
if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
fprintf(stderr, "Bogus memory allocation size\n");
- if (checkoverflow) return NULL;
- else exit(1);
+ if (checkoverflow) {
+ gfree(p);
+ return NULL;
+ } else {
+ exit(1);
+ }
}
return grealloc(p, n, checkoverflow);
}
More information about the poppler
mailing list