summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-08-15 20:05:45 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-08-15 20:05:45 (GMT)
commit98cad48171dd760e2d05fde320e87dad42bd5399 (patch)
tree08c02fc5eb03200303fff01588ec463962119598 /Objects
parentc8cb5d9d6950bb9e3b407c6b4a8dd2831f5edee9 (diff)
downloadcpython-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.c1
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