]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
plug possible refleak (closes #13199)
authorBenjamin Peterson <benjamin@python.org>
Mon, 17 Oct 2011 17:09:27 +0000 (13:09 -0400)
committerBenjamin Peterson <benjamin@python.org>
Mon, 17 Oct 2011 17:09:27 +0000 (13:09 -0400)
Objects/sliceobject.c

index 51c53a8a11c3c33778d1b4d4d8247e4b279d0387..d7b97c9699ad88af907cb6950e1da2aa60b2fd33 100644 (file)
@@ -320,9 +320,13 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
     }
 
     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);