[Python-checkins] bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)

corona10 webhook-mailer at python.org
Tue Mar 30 02:22:44 EDT 2021


https://github.com/python/cpython/commit/dfeec347f21b86879ba8f27f567bb275b243f1bc
commit: dfeec347f21b86879ba8f27f567bb275b243f1bc
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: corona10 <donghee.na92 at gmail.com>
date: 2021-03-30T15:22:34+09:00
summary:

bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038)

files:
M PC/winreg.c

diff --git a/PC/winreg.c b/PC/winreg.c
index fb488d8eb0296..004a89a5355f6 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



More information about the Python-checkins mailing list