summaryrefslogtreecommitdiff
path: root/numpy/core/src/multiarraymodule.c
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-09 17:22:28 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-09 17:22:28 +0000
commite62aa7ea3603ac5d7eb7b94da328aaed5868c8d0 (patch)
treee9a46748767fb6f65080ce4d32242246ebd064e9 /numpy/core/src/multiarraymodule.c
parent1ace4444065fe39b01739b85189e7fc5cd9fecdd (diff)
downloadnumpy-e62aa7ea3603ac5d7eb7b94da328aaed5868c8d0.tar.gz
Use a failure label when _array_fromobject fails.
Diffstat (limited to 'numpy/core/src/multiarraymodule.c')
-rw-r--r--numpy/core/src/multiarraymodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index 9c6454d3f..f22f9720d 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -6264,8 +6264,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
PyArray_OrderConverter, &order,
PyArray_BoolConverter, &subok,
&ndmin)) {
- Py_XDECREF(type);
- return NULL;
+ goto clean_type;
}
/* fast exit if simple call */
@@ -6332,6 +6331,10 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
* steals a reference to ret
*/
return _prepend_ones((PyArrayObject *)ret, nd, ndmin);
+
+clean_type:
+ Py_XDECREF(type);
+ return NULL;
}
/*NUMPY_API