mirror of https://github.com/python/cpython
Issue #20908: PyMem_Malloc() must be used with PyMem_Free(), not with free()
This commit is contained in:
parent
58c767fa30
commit
9cb1ec5fb5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue