[Python-checkins] cpython (2.7): fix possible refleaks

benjamin.peterson python-checkins at python.org
Wed Aug 17 05:28:36 CEST 2011


http://hg.python.org/cpython/rev/b4ccf8e1fdba
changeset: 71890:b4ccf8e1fdba
branch: 2.7
parent: 71882:80ac94ad381e
user: Benjamin Peterson <benjamin at python.org>
date: Tue Aug 16 22:26:48 2011 -0500
summary:
 fix possible refleaks
files:
 Objects/typeobject.c | 4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2235,8 +2235,10 @@
 (add_weak && strcmp(s, "__weakref__") == 0))
 continue;
 tmp =_Py_Mangle(name, tmp);
- if (!tmp)
+ if (!tmp) {
+ Py_DECREF(newslots);
 goto bad_slots;
+ }
 PyList_SET_ITEM(newslots, j, tmp);
 j++;
 }
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /