Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion numpy/_core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -5963,7 +5963,6 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
NPY_AUXDATA_FREE(auxdata);

Py_XDECREF(op2_array);
Py_XDECREF(iter);
Py_XDECREF(iter2);
for (int i = 0; i < nop; i++) {
Py_XDECREF(operation_descrs[i]);
Expand All @@ -5979,9 +5978,13 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
if (PyArray_FLAGS(op1_array) & NPY_ARRAY_WRITEBACKIFCOPY) {
PyArray_DiscardWritebackIfCopy(op1_array);
}
// iter might own the last refrence to op1_array,
// so it must be decref'd second
Py_XDECREF(iter);
return NULL;
}
else {
Py_XDECREF(iter);
Py_RETURN_NONE;
}
}
Expand Down