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

This commit is contained in:
Victor Stinner 2014-03-13 19:08:10 +01:00
parent 58c767fa30
commit 9cb1ec5fb5
1 changed files with 2 additions and 2 deletions

View File

@ -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,