[Python-checkins] cpython (merge 3.2 -> default): merge 3.2 (#13199)

benjamin.peterson python-checkins at python.org
Mon Oct 17 19:10:35 CEST 2011


http://hg.python.org/cpython/rev/7bf70519795c
changeset:   72958:7bf70519795c
parent:      72956:f6b3ad301851
parent:      72957:53c87a0275ab
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Oct 17 13:10:24 2011 -0400
summary:
  merge 3.2 (#13199)

files:
  Objects/sliceobject.c |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -347,9 +347,13 @@
     }
 
     t1 = PyTuple_New(3);
+    if (t1 == NULL)
+        return NULL;
     t2 = PyTuple_New(3);
-    if (t1 == NULL || t2 == NULL)
+    if (t2 == NULL) {
+        Py_DECREF(t1);
         return NULL;
+    }
 
     PyTuple_SET_ITEM(t1, 0, ((PySliceObject *)v)->start);
     PyTuple_SET_ITEM(t1, 1, ((PySliceObject *)v)->stop);

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


More information about the Python-checkins mailing list