diff options
| author | Hye-Shik Chang <hyeshik@gmail.com> | 2006-03-07 15:59:09 (GMT) |
|---|---|---|
| committer | Hye-Shik Chang <hyeshik@gmail.com> | 2006-03-07 15:59:09 (GMT) |
| commit | 361cd4bd6c9c2d56ed154922e016c47d4bee9482 (patch) | |
| tree | 52d919a372188402f40d1eb5a159a4a233efccff /Modules/arraymodule.c | |
| parent | 82735da0165cc8b0b080d7e28d4123c3168c4cf7 (diff) | |
| download | cpython-361cd4bd6c9c2d56ed154922e016c47d4bee9482.zip cpython-361cd4bd6c9c2d56ed154922e016c47d4bee9482.tar.gz cpython-361cd4bd6c9c2d56ed154922e016c47d4bee9482.tar.bz2 | |
Backport r42894: SF #1444030 Fix several potential defects found
by Coverity.
Diffstat (limited to 'Modules/arraymodule.c')
| -rw-r--r-- | Modules/arraymodule.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 0e78e65..f8c4918 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1826,10 +1826,13 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds) Py_DECREF(v); } } else if (initial != NULL && PyString_Check(initial)) { - PyObject *t_initial = PyTuple_Pack(1, - initial); - PyObject *v = - array_fromstring((arrayobject *)a, + PyObject *t_initial, *v; + t_initial = PyTuple_Pack(1, initial); + if (t_initial == NULL) { + Py_DECREF(a); + return NULL; + } + v = array_fromstring((arrayobject *)a, t_initial); Py_DECREF(t_initial); if (v == NULL) { |
