summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index c973366..6b7e01b 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -312,6 +312,7 @@ file_dealloc(PyFileObject *f)
(*f->f_close)(f->f_fp);
Py_END_ALLOW_THREADS
}
+ PyMem_Free(f->f_setbuf);
Py_XDECREF(f->f_name);
Py_XDECREF(f->f_mode);
Py_XDECREF(f->f_encoding);
@@ -358,6 +359,7 @@ file_close(PyFileObject *f)
f->f_fp = NULL;
}
PyMem_Free(f->f_setbuf);
+ f->f_setbuf = NULL;
if (sts == EOF)
return PyErr_SetFromErrno(PyExc_IOError);
if (sts != 0)