summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-10-17 23:07:41 +0200
committerAlbert Astals Cid <aacid@kde.org>2018-10-17 23:08:11 +0200
commit8dc68b38874ed1b8f61c051b9b9a5c41d6dd60c2 (patch)
tree1d3407710116e2a9c3ae01a940bea4cda64637e2
parentf162ecdea0dda5dbbdb45503c1d55d9afaa41d44 (diff)
GfxFunctionShading::parse: Fix memory leak on broken files
oss-fuzz/11020
-rw-r--r--poppler/GfxState.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index b5ee150b..09fc9793 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -3759,6 +3759,9 @@ GfxFunctionShading *GfxFunctionShading::parse(GfxResources *res, Dict *dict, Out
for (i = 0; i < nFuncsA; ++i) {
Object obj2 = obj1.arrayGet(i);
if (!(funcsA[i] = Function::parse(&obj2))) {
+ for (int j = 0; j < i; ++j) {
+ delete funcsA[j];
+ }
return nullptr;
}
}