[Python-checkins] cpython (merge 3.2 -> default): MERGE: Closes #15395: memory leaks in selectmodule.c

jesus.cea python-checkins at python.org
Thu Jul 19 21:33:22 CEST 2012


http://hg.python.org/cpython/rev/9985b4651436
changeset:   78183:9985b4651436
parent:      78181:b2dac78db1c9
parent:      78182:bc9b2956bb8b
user:        Jesus Cea <jcea at jcea.es>
date:        Thu Jul 19 21:32:07 2012 +0200
summary:
  MERGE: Closes #15395: memory leaks in selectmodule.c

files:
  Modules/selectmodule.c |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -107,7 +107,7 @@
 
         /* any intervening fileno() calls could decr this refcnt */
         if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i)))
-            return -1;
+            goto finally;
 
         Py_INCREF(o);
         v = PyObject_AsFileDescriptor( o );
@@ -438,6 +438,7 @@
     if (PyDict_GetItem(self->dict, key) == NULL) {
         errno = ENOENT;
         PyErr_SetFromErrno(PyExc_OSError);
+        Py_DECREF(key);
         return NULL;
     }
     value = PyLong_FromLong(events);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list