summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-05-09 14:34:57 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-05-09 14:38:51 +0200
commit270866ebac7920503c0856a5dd1e7937ab68dd5f (patch)
tree83fa4e7881d08853a066a45ad42639df738c92d6
parent22123c836b35c1e8a1feb831899aacd991597c45 (diff)
GfxDeviceNColorSpace::parse - Fix memory leak on broken files
-rw-r--r--poppler/GfxState.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 61b462a8..a9e9bb4e 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -3048,7 +3048,6 @@ GfxColorSpace *GfxDeviceNColorSpace::copy() {
//~ handle the 'None' colorant
GfxColorSpace *GfxDeviceNColorSpace::parse(GfxResources *res, Array *arr, OutputDev *out, GfxState *state, int recursion) {
- GfxDeviceNColorSpace *cs;
int nCompsA;
GooString *namesA[gfxColorMaxComps];
GfxColorSpace *altA;
@@ -3093,7 +3092,7 @@ GfxColorSpace *GfxDeviceNColorSpace::parse(GfxResources *res, Array *arr, Output
obj1 = arr->get(4);
if (!obj1.isDict()) {
error(errSyntaxWarning, -1, "Bad DeviceN color space (attributes)");
- goto err4;
+ goto err5;
}
Dict *attribs = obj1.getDict();
Object obj2 = attribs->lookup("Colorants");
@@ -3105,14 +3104,15 @@ GfxColorSpace *GfxDeviceNColorSpace::parse(GfxResources *res, Array *arr, Output
separationList->append(GfxSeparationColorSpace::parse(res, obj3.getArray(), out, state, recursion));
} else {
error(errSyntaxWarning, -1, "Bad DeviceN color space (colorant value entry is not an Array)");
- goto err4;
+ goto err5;
}
}
}
}
- cs = new GfxDeviceNColorSpace(nCompsA, namesA, altA, funcA, separationList);
- return cs;
+ return new GfxDeviceNColorSpace(nCompsA, namesA, altA, funcA, separationList);
+ err5:
+ delete funcA;
err4:
delete altA;
err3: