From dfeec347f21b86879ba8f27f567bb275b243f1bc Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Tue, 30 Mar 2021 00:22:34 -0600 Subject: [PATCH] bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) --- PC/winreg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/PC/winreg.c b/PC/winreg.c index fb488d8eb02..004a89a5355 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