diff options
-rw-r--r-- | mupdf/pdf_annot.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mupdf/pdf_annot.c b/mupdf/pdf_annot.c index fff8fad7..56826f8f 100644 --- a/mupdf/pdf_annot.c +++ b/mupdf/pdf_annot.c @@ -165,7 +165,8 @@ pdf_loadannots(pdf_comment **cp, pdf_link **lp, pdf_xref *xref, fz_obj *annots) error = pdf_resolve(&obj, xref); if (error) { - pdf_droplink(link); + if (link) + pdf_droplink(link); return fz_rethrow(error, "cannot resolve annotation"); } @@ -178,7 +179,8 @@ pdf_loadannots(pdf_comment **cp, pdf_link **lp, pdf_xref *xref, fz_obj *annots) fz_dropobj(obj); if (error) { - pdf_droplink(link); + if (link) + pdf_droplink(link); return fz_rethrow(error, "cannot load annotation link"); } |