]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 30 Mar 2021 07:52:13 +0000 (00:52 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Mar 2021 07:52:13 +0000 (00:52 -0700)
(cherry picked from commit dfeec347f21b86879ba8f27f567bb275b243f1bc)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
PC/winreg.c

index caad18e045bcb9a71653401138da736a2a224f02..8c443311174da1454b58c4f73a45fd30da24de6c 100644 (file)
@@ -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