diff options
author | Travis Oliphant <oliphant@enthought.com> | 2008-03-28 05:03:50 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2008-03-28 05:03:50 +0000 |
commit | b8f582defd3c10e5e38018970bb52ab693951dfa (patch) | |
tree | aec333c41746da37166e4717c91567d7c9ca1300 /numpy/core/src/arrayobject.c | |
parent | b30372185f472b29d4b2ac3f703359b9376a8b60 (diff) | |
download | numpy-b8f582defd3c10e5e38018970bb52ab693951dfa.tar.gz |
Fix some Py_INCREF's to Py_XINCREF to avoid segfault when NULL is stored.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index d9b4c7b90..507ee3c0c 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -862,7 +862,7 @@ int _flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) { it = (PyArrayIterObject *)PyArray_IterAllButAxis(src, &axis); if (it == NULL) { - if (src != orig_src) Py_DECREF(src); + if (src != orig_src) {Py_DECREF(src);} return -1; } @@ -890,7 +890,7 @@ int _flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) { } NPY_END_THREADS - if (src != orig_src) Py_DECREF(src); + if (src != orig_src) {Py_DECREF(src);} Py_DECREF(it); return 0; } |