SF #1444030: Fix several potential defects found by Coverity.

(reviewed by Neal Norwitz)
This commit is contained in:
Hye-Shik Chang 2006-03-07 15:39:21 +00:00
parent ef1701f7d3
commit 4af5c8cee4
11 changed files with 53 additions and 17 deletions

View file

@ -1852,10 +1852,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) {