Commit 7184366d authored by Victor Stinner's avatar Victor Stinner

Issue #19437: Fix PyCData_GetContainer() of ctypes, handle PyDict_New() failure

parent 22af2599
...@@ -2331,6 +2331,8 @@ PyCData_GetContainer(CDataObject *self) ...@@ -2331,6 +2331,8 @@ PyCData_GetContainer(CDataObject *self)
if (self->b_objects == NULL) { if (self->b_objects == NULL) {
if (self->b_length) { if (self->b_length) {
self->b_objects = PyDict_New(); self->b_objects = PyDict_New();
if (self->b_objects == NULL)
return NULL;
} else { } else {
Py_INCREF(Py_None); Py_INCREF(Py_None);
self->b_objects = Py_None; self->b_objects = Py_None;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment