Author: georg.brandl
Date: Sun Nov 25 01:52:21 2007
New Revision: 59181

Modified:
   python/branches/py3k/Modules/_csv.c
Log:
#1479: Fix refleak in csv module (from rev 59062).


Modified: python/branches/py3k/Modules/_csv.c
==============================================================================
--- python/branches/py3k/Modules/_csv.c (original)
+++ python/branches/py3k/Modules/_csv.c Sun Nov 25 01:52:21 2007
@@ -793,14 +793,13 @@
                                             "newline inside string");
                         return NULL;
                 }
-               if (!PyUnicode_Check(lineobj))
-               {
-                       PyErr_Format(error_obj,
-                                    "Iterator should return strings, "
-                                    "not %.200s "
-                                    "(did you open the file in text mode?)",
+               if (!PyUnicode_Check(lineobj)) {
+                       PyErr_Format(error_obj, "iterator should return "
+                                    "strings, not %.200s (did you open "
+                                    "the file in text mode?)",
                                     lineobj->ob_type->tp_name
                                );
+                       Py_DECREF(lineobj);
                        return NULL;
                }
                 ++self->line_num;
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to