]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport Neal's fix for bug #789402 -- a memory leak in fileobject.c
authorRaymond Hettinger <python@rcn.com>
Tue, 16 Sep 2003 05:29:50 +0000 (05:29 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 16 Sep 2003 05:29:50 +0000 (05:29 +0000)
Misc/NEWS
Objects/fileobject.c

index c60771af2ba6b0ef9f586d691996e226829550dd..7912ae4ab5bba8ef9a6d04dfde47f62ee8e4f282 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 2.3.1?
 Core and builtins
 -----------------
 
+- Bug #789402, fixed memory leak when opening a file object.
+
 - Fixed a leak when new code objects are instantiated.
 
 - Bug #800796: slice(1).__hash__() now raises a TypeError, unhashable type.
index 3e41704dcf006dfdafc204a20855f0b85cb9bc81..6a2b5fb9c5823e0e6e0a8a4f0361893820f36dcc 100644 (file)
@@ -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