diff options
Diffstat (limited to 'Modules/getpath.c')
-rw-r--r-- | Modules/getpath.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index 237fe8c..b9914a0 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -341,11 +341,12 @@ getpath_readlines(PyObject *Py_UNUSED(self), PyObject *args) return NULL; } FILE *fp = _Py_wfopen(path, L"rb"); - PyMem_Free((void *)path); if (!fp) { PyErr_SetFromErrno(PyExc_OSError); + PyMem_Free((void *)path); return NULL; } + PyMem_Free((void *)path); r = PyList_New(0); if (!r) { |