summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-02-20 09:52:53 +0200
committerGitHub <noreply@github.com>2019-02-20 09:52:53 +0200
commitd2517ed1311e12bda3c453dd43f4979b84ef60b3 (patch)
treed38f704bbc2378b972181754b373dbf80e9b7016
parent378cadfaf3e5a8b5d84583e5ee7f2d25bfa97cb4 (diff)
parent941a2caa8b4d3d612c8d83313bc7a6b29a01eaca (diff)
downloadnumpy-d2517ed1311e12bda3c453dd43f4979b84ef60b3.tar.gz
Merge pull request #12995 from eric-wieser/missing-PyErr_NoMemory
BUG: Add missing PyErr_NoMemory() for reporting a failed malloc
-rw-r--r--numpy/core/src/multiarray/compiled_base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 625028bfb..235e389e8 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -567,6 +567,7 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
if (lenxp <= lenx) {
slopes = PyArray_malloc((lenxp - 1) * sizeof(npy_double));
if (slopes == NULL) {
+ PyErr_NoMemory();
goto fail;
}
}
@@ -736,6 +737,7 @@ arr_interp_complex(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
if (lenxp <= lenx) {
slopes = PyArray_malloc((lenxp - 1) * sizeof(npy_cdouble));
if (slopes == NULL) {
+ PyErr_NoMemory();
goto fail;
}
}