summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-03-30 07:51:55 (GMT)
committerGitHub <noreply@github.com>2021-03-30 07:51:55 (GMT)
commitf79577ddbd7c87b6cc1810e98ee4eaca7ae50699 (patch)
tree0c83f655d93efa3e06850316ad91bc677a257f4a
parent05429c917c23f735b07ac4c60af20e57aad742fc (diff)
downloadcpython-f79577ddbd7c87b6cc1810e98ee4eaca7ae50699.zip
cpython-f79577ddbd7c87b6cc1810e98ee4eaca7ae50699.tar.gz
cpython-f79577ddbd7c87b6cc1810e98ee4eaca7ae50699.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 01e3e9f..fd1ccb7 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1788,6 +1788,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