Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef9cf08

Browse files
committed
fix refleak in error condition
1 parent c836f71 commit ef9cf08

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Modules/zipimport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ get_data(PyObject *archive, PyObject *toc_entry)
11271127
bytes_read = fread(buf, 1, data_size, fp);
11281128
} else {
11291129
fclose(fp);
1130+
Py_DECREF(raw_data);
11301131
PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
11311132
return NULL;
11321133
}

0 commit comments

Comments
 (0)