aboutsummaryrefslogtreecommitdiffstats
path: root/src/cnki_pdf.c
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2022-12-22 11:22:41 +0000
committeryzrh <yzrh@noema.org>2022-12-22 19:48:48 +0000
commitac3b1dda63944f2cc8caaa52344774255e1956c8 (patch)
tree2fb8b24fbfe8002f39288926fa06c71100102868 /src/cnki_pdf.c
parent63728e1340a27b7ae629a747229871f3dc670de5 (diff)
downloadmelon-ac3b1dda63944f2cc8caaa52344774255e1956c8.tar.gz
melon-ac3b1dda63944f2cc8caaa52344774255e1956c8.tar.zst
Fix memory leak and data type.
Signed-off-by: yzrh <yzrh@noema.org>
Diffstat (limited to 'src/cnki_pdf.c')
-rw-r--r--src/cnki_pdf.c6
1 files changed, 6 insertions, 0 deletions
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 {