Skip to content

Commit 50c82be

Browse files
committed
Fix refcounting for _CTYPES_DEBUG_KEEP builds
1 parent 7c08d60 commit 50c82be

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_ctypes/cfield.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) {
420420
if (res == NULL) { \
421421
return NULL; \
422422
} \
423+
Py_DECREF(res); \
423424
CTYPE field; \
424425
memcpy(&field, ptr, sizeof(field)); \
425426
field = PY_SWAPFUNC(field); \

0 commit comments

Comments
 (0)