]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36421: Fix a possible double decref in _ctypes.c's PyCArrayType_new(). (GH-12530)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 25 Mar 2019 08:34:26 +0000 (01:34 -0700)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2019 08:34:26 +0000 (01:34 -0700)
commitfa27870992a7228c8bf378d53649ee22333b69db
treeb9ac5c006f058352448f52095db288210711ad23
parent9dbb09fc27b99d2c08b8f56db71018eb828cc7cd
bpo-36421: Fix a possible double decref in _ctypes.c's PyCArrayType_new(). (GH-12530)

Set type_attr to NULL after the assignment to stgdict->proto (like
what is done with stgdict after the Py_SETREF() call) so that it is
not decrefed twice on error.
(cherry picked from commit 5e333784f007950f22de44c1ffab5b0c03d6691f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Misc/NEWS.d/next/Core and Builtins/2019-03-24-21-33-22.bpo-36421.gJ2Pv9.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes.c