[Python-checkins] r69649 - python/branches/io-c/Modules/_iobase.c

antoine.pitrou python-checkins at python.org
Sun Feb 15 21:05:14 CET 2009


Author: antoine.pitrou
Date: Sun Feb 15 21:05:13 2009
New Revision: 69649

Log:
Fix a leak in IOBase.writelines



Modified:
   python/branches/io-c/Modules/_iobase.c

Modified: python/branches/io-c/Modules/_iobase.c
==============================================================================
--- python/branches/io-c/Modules/_iobase.c	(original)
+++ python/branches/io-c/Modules/_iobase.c	Sun Feb 15 21:05:13 2009
@@ -586,7 +586,7 @@
 
     while (1) {
         PyObject *line = PyIter_Next(iter);
-        if(line == NULL) {
+        if (line == NULL) {
             if (PyErr_Occurred()) {
                 Py_DECREF(iter);
                 return NULL;
@@ -603,6 +603,7 @@
         }
         Py_DECREF(res);
     }
+    Py_DECREF(iter);
     Py_RETURN_NONE;
 }
 


More information about the Python-checkins mailing list