Commit 93e8012f authored by Zackery Spytz's avatar Zackery Spytz Committed by Serhiy Storchaka

bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)

If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(),
_PyUnicodeWriter_Dealloc() will be called on an uninitialized
_PyUnicodeWriter.
parent 9a0000d1
......@@ -176,7 +176,7 @@ structseq_repr(PyStructSequence *obj)
strlen(typ->tp_name),
NULL);
if (type_name == NULL) {
goto error;
return NULL;
}
_PyUnicodeWriter_Init(&writer);
......
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