summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-03-30 07:52:13 (GMT)
committerGitHub <noreply@github.com>2021-03-30 07:52:13 (GMT)
commit5486b105a4c5de840c24776c726eeac2a8dc973c (patch)
treeaa55ba56935da8a1e85ee0f3505154ccfe80ad83
parent6af3a940ca827d9a59e34271e4c97d7ec7b56584 (diff)
downloadcpython-5486b105a4c5de840c24776c726eeac2a8dc973c.zip
cpython-5486b105a4c5de840c24776c726eeac2a8dc973c.tar.gz
cpython-5486b105a4c5de840c24776c726eeac2a8dc973c.tar.bz2
bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)
(cherry picked from commit dfeec347f21b86879ba8f27f567bb275b243f1bc) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
-rw-r--r--PC/winreg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index caad18e..8c44331 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1782,6 +1782,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