Description
Bug report
Bug description:
-
I have found that
layout_func
may leak when creating ofkwnames
fails:
cpython/Modules/_ctypes/stgdict.c
Lines 260 to 270 in e82c2ca
But on error it doesn't clearlayout_func
:
cpython/Modules/_ctypes/stgdict.c
Lines 665 to 671 in e82c2ca
-
StructParam_traverse
should VISITkeep
member:
cpython/Modules/_ctypes/_ctypes.c
Lines 412 to 416 in e82c2ca
-
PyCSimpleType_init
should DECREFswapped
local variable if no StgInfo:
cpython/Modules/_ctypes/_ctypes.c
Lines 2373 to 2382 in e82c2ca
-
make_funcptrtype_dict
should DECREF 'ob' local variable if no StgInfo:
cpython/Modules/_ctypes/_ctypes.c
Lines 2670 to 2677 in e82c2ca
-
Not memory leak, but possible crush.
Pointer_subscript
should checkPointer_item
result before putting it to result list:
cpython/Modules/_ctypes/_ctypes.c
Lines 5650 to 5653 in e82c2ca
-
As discussed at gh-131311: Fix memory leak in PyCStructUnionType_update_stginfo #131312 we should split PyCStructUnionType_update_stginfo and manage
type_block
in separate function.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response