Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Checkins
cpython (3.2): fix possible refleak (closes #14752)
 

Index | Next | Previous | View Flat


python-checkins at python

May 8, 2012, 6:23 AM


Views: 42
Permalink
cpython (3.2): fix possible refleak (closes #14752)

http://hg.python.org/cpython/rev/d937b527b76e
changeset: 76836:d937b527b76e
branch: 3.2
parent: 76834:91612618985b
user: Benjamin Peterson <benjamin [at] python>
date: Tue May 08 09:22:24 2012 -0400
summary:
fix possible refleak (closes #14752)

files:
Objects/typeobject.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3527,6 +3527,7 @@

for (; meth->ml_name != NULL; meth++) {
PyObject *descr;
+ int err;
if (PyDict_GetItemString(dict, meth->ml_name) &&
!(meth->ml_flags & METH_COEXIST))
continue;
@@ -3550,9 +3551,10 @@
}
if (descr == NULL)
return -1;
- if (PyDict_SetItemString(dict, meth->ml_name, descr) < 0)
+ err = PyDict_SetItemString(dict, meth->ml_name, descr);
+ Py_DECREF(descr);
+ if (err < 0)
return -1;
- Py_DECREF(descr);
}
return 0;
}

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

Subject User Time
cpython (3.2): fix possible refleak (closes #14752) python-checkins at python May 8, 2012, 6:23 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.