Skip to content

Commit a4f8468

Browse files
Fix memory leak in PyCStructUnionType_update_stginfo
1 parent e82c2ca commit a4f8468

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
267267
&_Py_ID(is_struct),
268268
&_Py_ID(base));
269269
if (!kwnames) {
270+
Py_DECREF(layout_func);
270271
goto error;
271272
}
272273
layout = PyObject_Vectorcall(

0 commit comments

Comments
 (0)