Skip to content

Commit 16d6996

Browse files
authored
BUG: fix reference counting bug in __array_interface__ implementation (numpy#27249)
* BUG: fix reference counting bug in __array_interface__ implementation * MAINT: only decref if the reference is valid
1 parent 83cd89b commit 16d6996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/_core/src/multiarray/ctors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,8 +2232,8 @@ PyArray_FromInterface(PyObject *origin)
22322232
Py_SETREF(dtype, new_dtype);
22332233
}
22342234
}
2235+
Py_DECREF(descr);
22352236
}
2236-
Py_DECREF(descr);
22372237
}
22382238
Py_CLEAR(attr);
22392239

0 commit comments

Comments
 (0)