From ac3b1dda63944f2cc8caaa52344774255e1956c8 Mon Sep 17 00:00:00 2001 From: yzrh Date: Thu, 22 Dec 2022 11:22:41 +0000 Subject: Fix memory leak and data type. Signed-off-by: yzrh --- src/cnki_pdf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cnki_pdf.c') diff --git a/src/cnki_pdf.c b/src/cnki_pdf.c index 6a7a317..dcf6d30 100644 --- a/src/cnki_pdf.c +++ b/src/cnki_pdf.c @@ -419,8 +419,14 @@ cnki_pdf(cnki_t **param) if ((*param)->stat > 1) printf("Deleting xref object\n"); + pdf_object_t *tmp; + + pdf_get_obj(&pdf, xref, &tmp); pdf_obj_del(&pdf, xref); + tmp->next = NULL; + pdf_obj_destroy(&tmp); + if ((*param)->stat > 0) printf("Deleted xref object\n"); } else { -- cgit v1.2.3