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

This commit is contained in:
Zackery Spytz 2021-03-30 00:22:34 -06:00 committed by GitHub
parent 068ebf9729
commit dfeec347f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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