]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)
authorZackery Spytz <zspytz@gmail.com>
Tue, 30 Mar 2021 06:22:34 +0000 (00:22 -0600)
committerGitHub <noreply@github.com>
Tue, 30 Mar 2021 06:22:34 +0000 (15:22 +0900)
PC/winreg.c

index fb488d8eb029603ba17ad822ee78c02e202e84f9..004a89a5355f6c52ffa1f9ad7c5ac890fcbf4cef 100644 (file)
@@ -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