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 fb1656a..71e23e1 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -342,11 +342,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) { |