summaryrefslogtreecommitdiffstats
path: root/Modules/_hashopenssl.c
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2021-05-12 16:04:34 (GMT)
committerGitHub <noreply@github.com>2021-05-12 16:04:34 (GMT)
commit3611db53f5b854cb6d01ee5ebb5e11c87bcc2df5 (patch)
treeeb59d2310a37b5f326867e226078e601f29e2058 /Modules/_hashopenssl.c
parentc40486a32d7e37b01ead94e701d69847f5b60e30 (diff)
downloadcpython-3611db53f5b854cb6d01ee5ebb5e11c87bcc2df5.zip
cpython-3611db53f5b854cb6d01ee5ebb5e11c87bcc2df5.tar.gz
cpython-3611db53f5b854cb6d01ee5ebb5e11c87bcc2df5.tar.bz2
bpo-40645: Fix reference leak in the _hashopenssl extension (GH-26072)
The `PyModule_AddObjectRef` function doesn't steal a reference, so an extra `Py_DECREF` is needed. Automerge-Triggered-By: GH:tiran
Diffstat (limited to 'Modules/_hashopenssl.c')
-rw-r--r--Modules/_hashopenssl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index b2c6775..13634a5 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -2109,6 +2109,7 @@ hashlib_init_constructors(PyObject *module)
if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) {
return -1;
}
+ Py_DECREF(proxy);
return 0;
}