From dfcb3f8b222240f1da9d5a5d57a326ac7dfda39c Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 19 Apr 2008 23:24:30 +0200 Subject: Clear returned pointer to parsed array/dict when encountering error, so above layers can properly use pointer to detect when to free object. --- mupdf/pdf_parse.c | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- cgit v1.2.3