Fix mem leak on loading multiple PDFs with buffe rin single doc

This commit is contained in:
Kovid Goyal 2023-05-20 14:12:25 +05:30
parent a79795dca9
commit 0638359f0f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -46,6 +46,7 @@ PDFDoc_load(PDFDoc *self, PyObject *args) {
try {
self->doc->LoadFromBuffer(bufferview(buffer, size));
Py_CLEAR(self->load_buffer_ref);
self->load_buffer_ref = args;
Py_INCREF(args);
} catch(const PdfError & err) {