mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
_PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's
suggestion (modulo style).
This commit is contained in:
parent
3a2ab1ab69
commit
0dcea5973d
1 changed files with 1 additions and 1 deletions
|
@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize)
|
||||||
(current) reference */
|
(current) reference */
|
||||||
Py_DECREF(v);
|
Py_DECREF(v);
|
||||||
*pv = PyTuple_New(newsize);
|
*pv = PyTuple_New(newsize);
|
||||||
return 0;
|
return *pv == NULL ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX UNREF/NEWREF interface should be more symmetrical */
|
/* XXX UNREF/NEWREF interface should be more symmetrical */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue