mirror of https://github.com/python/cpython
Issue #19437: Fix error handling of CDataType_from_buffer()
KeepRef() decreases the reference counter of its 'keep' parameter on error
This commit is contained in:
parent
ed4a1c5703
commit
2399ad51d4
|
@ -454,7 +454,6 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
|
|||
|
||||
Py_INCREF(obj);
|
||||
if (-1 == KeepRef((CDataObject *)result, -1, obj)) {
|
||||
Py_DECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue