]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
_PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's
authorThomas Wouters <thomas@python.org>
Tue, 29 May 2001 08:05:01 +0000 (08:05 +0000)
committerThomas Wouters <thomas@python.org>
Tue, 29 May 2001 08:05:01 +0000 (08:05 +0000)
suggestion (modulo style).

Objects/tupleobject.c

index 461b3255da7ab6a3072472a8e14082b18207c8da..183fd33319aadc432d1daa5faa0dde8b71233c23 100644 (file)
@@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize, int last_is_sticky)
                   (current) reference */
                Py_DECREF(v);
                *pv = PyTuple_New(newsize);
-               return 0;
+               return *pv == NULL ? -1 : 0;
        }
 
        /* XXX UNREF/NEWREF interface should be more symmetrical */