summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher L. Farrow <cfarrow@enthought.com>2011-08-26 22:39:55 -0500
committerCharles Harris <charlesr.harris@gmail.com>2011-10-02 09:09:39 -0600
commit63dff6b50eeb090fac208ac09cd7e2e977a531ae (patch)
tree1e4e2ceb3ac55e9cb0d952dc4f016ef10c043732
parentb331af180ce13dded190045f2ecccc4b1ce12464 (diff)
downloadnumpy-63dff6b50eeb090fac208ac09cd7e2e977a531ae.tar.gz
BUG: fixed reference counting bug in PyArray_FromScalar that occurs when using an extended dtype
-rw-r--r--numpy/core/src/multiarray/scalarapi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c
index 41ba4c6ae..0ee4a3b09 100644
--- a/numpy/core/src/multiarray/scalarapi.c
+++ b/numpy/core/src/multiarray/scalarapi.c
@@ -339,6 +339,7 @@ finish:
if (outcode->type_num == typecode->type_num) {
if (!PyTypeNum_ISEXTENDED(typecode->type_num)
|| (outcode->elsize == typecode->elsize)) {
+ Py_DECREF(outcode);
return (PyObject *)r;
}
}