bpo-38823: Fix refleaks in _ctypes extension init by vstinner · Pull Request #23247 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-38823: Fix refleaks in _ctypes extension init
Fix reference leaks in the error path of the initialization function
the _ctypes extension module: call Py_DECREF(mod) on error.

Change PyCFuncPtr_Type name from _ctypes.PyCFuncPtr to
_ctypes.CFuncPtr to be consistent with the name exposed in the
_ctypes namespace (_ctypes.CFuncPtr).

Split PyInit__ctypes() function into sub-functions and add macros for
readability.
  • Loading branch information
vstinner committed Nov 12, 2020
commit 31f5d883cdcae4aef913de2a854ef837fc1597cb
310 changes: 153 additions & 157 deletions Modules/_ctypes/_ctypes.c
Loading