summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2021-03-30 06:22:34 (GMT)
committerGitHub <noreply@github.com>2021-03-30 06:22:34 (GMT)
commitdfeec347f21b86879ba8f27f567bb275b243f1bc (patch)
tree00c383d6993cd0ae8f631084154771f277ab31e4 /PC
parent068ebf9729d440cef03e4c57e3db83c851146172 (diff)
downloadcpython-dfeec347f21b86879ba8f27f567bb275b243f1bc.zip
cpython-dfeec347f21b86879ba8f27f567bb275b243f1bc.tar.gz
cpython-dfeec347f21b86879ba8f27f567bb275b243f1bc.tar.bz2
bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index fb488d8..004a89a 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1813,6 +1813,7 @@ winreg_SetValueEx_impl(PyObject *module, HKEY key,
if (PySys_Audit("winreg.SetValue", "nunO",
(Py_ssize_t)key, value_name, (Py_ssize_t)type,
value) < 0) {
+ PyMem_Free(data);
return NULL;
}
Py_BEGIN_ALLOW_THREADS