summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/fileobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 43b81ed..96d3830 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -660,6 +660,9 @@ get_line(PyFileObject *f, int n)
n1 = getline(&buf, &size, fp);
Py_END_ALLOW_THREADS
if (n1 == -1) {
+ if (buf){
+ free(buf);
+ }
clearerr(fp);
if (PyErr_CheckSignals()) {
return NULL;