Commit 98cad481 authored by Neal Norwitz's avatar Neal Norwitz

Fix SF #789402, Memory leak on open()

If opening a directory, the exception would leak.
parent c8cb5d9d
...@@ -99,6 +99,7 @@ dircheck(PyFileObject* f) ...@@ -99,6 +99,7 @@ dircheck(PyFileObject* f)
PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)",
EISDIR, msg); EISDIR, msg);
PyErr_SetObject(PyExc_IOError, exc); PyErr_SetObject(PyExc_IOError, exc);
Py_XDECREF(exc);
return NULL; return NULL;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment