Commit 9cb1ec5f authored by Victor Stinner's avatar Victor Stinner

Issue #20908: PyMem_Malloc() must be used with PyMem_Free(), not with free()

parent 58c767fa
......@@ -944,7 +944,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
fixupMultiSZ(str, data, len);
obData = PyList_New(s);
if (obData == NULL) {
free(str);
PyMem_Free(str);
return NULL;
}
for (index = 0; index < s; index++)
......@@ -954,7 +954,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
PyErr_SetString(PyExc_OverflowError,
"registry string is too long for a Python string");
Py_DECREF(obData);
free(str);
PyMem_Free(str);
return NULL;
}
PyList_SetItem(obData,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment