From: Zackery Spytz Date: Tue, 30 Mar 2021 06:22:34 +0000 (-0600) Subject: bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) X-Git-Tag: v3.10.0a7~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfeec347f21b86879ba8f27f567bb275b243f1bc;p=thirdparty%2FPython%2Fcpython.git bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) --- diff --git a/PC/winreg.c b/PC/winreg.c index fb488d8eb029..004a89a5355f 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