Kaydet (Commit) 8528c314 authored tarafından Stefan Krah's avatar Stefan Krah

Issue #15728: Fix leak in PyUnicode_AsWideCharString(). Found by Coverity.

üst a19de803
......@@ -2935,8 +2935,10 @@ PyUnicode_AsWideCharString(PyObject *unicode,
return NULL;
}
buflen = unicode_aswidechar(unicode, buffer, buflen);
if (buflen == -1)
if (buflen == -1) {
PyMem_FREE(buffer);
return NULL;
}
if (size != NULL)
*size = buflen;
return buffer;
......
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