diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-08-15 20:05:45 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-08-15 20:05:45 (GMT) |
commit | 98cad48171dd760e2d05fde320e87dad42bd5399 (patch) | |
tree | 08c02fc5eb03200303fff01588ec463962119598 /Objects | |
parent | c8cb5d9d6950bb9e3b407c6b4a8dd2831f5edee9 (diff) | |
download | cpython-98cad48171dd760e2d05fde320e87dad42bd5399.zip cpython-98cad48171dd760e2d05fde320e87dad42bd5399.tar.gz cpython-98cad48171dd760e2d05fde320e87dad42bd5399.tar.bz2 |
Fix SF #789402, Memory leak on open()
If opening a directory, the exception would leak.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 1cc6def..13354c8 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -99,6 +99,7 @@ dircheck(PyFileObject* f) PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", EISDIR, msg); PyErr_SetObject(PyExc_IOError, exc); + Py_XDECREF(exc); return NULL; } #endif |