Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7184366

Browse files
committed
Issue #19437: Fix PyCData_GetContainer() of ctypes, handle PyDict_New() failure
1 parent 22af259 commit 7184366

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Modules/_ctypes/_ctypes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,8 @@ PyCData_GetContainer(CDataObject *self)
23312331
if (self->b_objects == NULL) {
23322332
if (self->b_length) {
23332333
self->b_objects = PyDict_New();
2334+
if (self->b_objects == NULL)
2335+
return NULL;
23342336
} else {
23352337
Py_INCREF(Py_None);
23362338
self->b_objects = Py_None;

0 commit comments

Comments
 (0)