]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)
authorAmmar Askar <ammar@ammaraskar.com>
Wed, 6 Nov 2019 15:40:06 +0000 (10:40 -0500)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Wed, 6 Nov 2019 15:40:06 +0000 (15:40 +0000)
commit484edbf9bf1a9e6bae0fcb10a0c165b89ea79295
tree01d000aca3b7e917811144a7857a7917b27ff27b
parent91f4b9282fe7cdc51c6612002d033da654f422c1
bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)

The master and 3.8 versions of the previous change work as expected
because we perform the lookup for the `from_param` after the union
check. However, in 3.7, this lookup happens before the union
validation and so we must decrease the reference for `cnv` before
returning.
Modules/_ctypes/_ctypes.c