summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-17 20:00:52 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-17 20:00:52 (GMT)
commit5de1594e2886aa1c779ba0a041d48d4ccea56a06 (patch)
tree07751cc7f3c15f3155e8bc1edf190bfe04c07655 /Objects
parent831755694a4fb264538a208adf3f750988d67b0e (diff)
downloadcpython-5de1594e2886aa1c779ba0a041d48d4ccea56a06.zip
cpython-5de1594e2886aa1c779ba0a041d48d4ccea56a06.tar.gz
cpython-5de1594e2886aa1c779ba0a041d48d4ccea56a06.tar.bz2
Merged revisions 81275 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81275 | antoine.pitrou | 2010-05-17 21:56:59 +0200 (lun., 17 mai 2010) | 4 lines Issue #7079: Fix a possible crash when closing a file object while using it from another thread. Patch by Daniel Stutzbach. ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index b9d9097..df5a102 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -568,8 +568,10 @@ static PyObject *
file_close(PyFileObject *f)
{
PyObject *sts = close_the_file(f);
- PyMem_Free(f->f_setbuf);
- f->f_setbuf = NULL;
+ if (sts) {
+ PyMem_Free(f->f_setbuf);
+ f->f_setbuf = NULL;
+ }
return sts;
}