Skip to content

Commit 048cc1d

Browse files
committed
Fix memory leak
1 parent fed1d1d commit 048cc1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/isal/isal_zlibmodule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,11 @@ ParallelCompress_compress_and_crc(ParallelCompress *self, PyObject *args)
432432
if (out_bytes == NULL) {
433433
goto error;
434434
}
435-
return Py_BuildValue("(OI)", out_bytes, crc);
435+
PyBuffer_Release(&data);
436+
PyBuffer_Release(&zdict);
437+
PyObject *ret= Py_BuildValue("(OI)", out_bytes, crc);
438+
Py_DECREF(out_bytes);
439+
return ret;
436440
error:
437441
PyBuffer_Release(&data);
438442
PyBuffer_Release(&zdict);

0 commit comments

Comments
 (0)