Skip to content

Commit e1bedf7

Browse files
committed
Fix PyErr_NoMemory errors in _ctypes.c
1 parent a5be0d8 commit e1bedf7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Modules/_ctypes/_ctypes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ StructUnionType_paramfunc(ctypes_state *st, CDataObject *self)
673673
if ((size_t)self->b_size > sizeof(void*)) {
674674
ptr = PyMem_Malloc(self->b_size);
675675
if (ptr == NULL) {
676+
PyErr_NoMemory();
676677
return NULL;
677678
}
678679
memcpy(ptr, self->b_ptr, self->b_size);

0 commit comments

Comments
 (0)