summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2008-04-19 23:24:30 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2008-04-19 23:24:30 +0200
commitdfcb3f8b222240f1da9d5a5d57a326ac7dfda39c (patch)
treeef9739b55ea7ae7c78ab53b8b84db3ddabb8113d
parente5cfecd323fa9729a93c1684a7a2e82a52550069 (diff)
downloadmupdf-dfcb3f8b222240f1da9d5a5d57a326ac7dfda39c.tar.xz
Clear returned pointer to parsed array/dict when encountering error, so above layers can properly use pointer to detect when to free object.
-rw-r--r--mupdf/pdf_parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mupdf/pdf_parse.c b/mupdf/pdf_parse.c
index 428a5d03..cdd58e87 100644
--- a/mupdf/pdf_parse.c
+++ b/mupdf/pdf_parse.c
@@ -213,6 +213,7 @@ pdf_parsearray(fz_obj **op, fz_stream *file, char *buf, int cap)
cleanup:
if (obj) fz_dropobj(obj);
if (ary) fz_dropobj(ary);
+ *op = nil;
return fz_rethrow(error, "cannot parse array");
}
@@ -313,6 +314,7 @@ cleanup:
if (key) fz_dropobj(key);
if (val) fz_dropobj(val);
if (dict) fz_dropobj(dict);
+ *op = nil;
return fz_rethrow(error, "cannot parse dict");
}