[Python-checkins] bpo-46323: Fix double-free issue for borrowed refs (GH-31272)

corona10 webhook-mailer at python.org
Fri Feb 11 03:49:09 EST 2022


https://github.com/python/cpython/commit/0ac5372bf6b937ed44a8f9c4e402d024fcd80870
commit: 0ac5372bf6b937ed44a8f9c4e402d024fcd80870
branch: main
author: Dong-hee Na <donghee.na at python.org>
committer: corona10 <donghee.na92 at gmail.com>
date: 2022-02-11T17:48:47+09:00
summary:

bpo-46323: Fix double-free issue for borrowed refs (GH-31272)

files:
M Modules/_ctypes/callbacks.c

diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 6037f5fd84286..bb59456a7321a 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -189,7 +189,6 @@ static void _CallPythonObject(void *mem,
             CDataObject *obj = (CDataObject *)_PyObject_CallNoArgs(cnv);
             if (!obj) {
                 PrintError("create argument %zd:\n", i);
-                Py_DECREF(cnv);
                 goto Done;
             }
             if (!CDataObject_Check(obj)) {



More information about the Python-checkins mailing list