Commit 110ac16b authored by Christian Heimes's avatar Christian Heimes

Fixed resource leak to scratch when _PyUnicodeWriter_Prepare fails

parent f03572d0
...@@ -1628,8 +1628,10 @@ long_to_decimal_string_internal(PyObject *aa, ...@@ -1628,8 +1628,10 @@ long_to_decimal_string_internal(PyObject *aa,
strlen++; strlen++;
} }
if (writer) { if (writer) {
if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1) if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1) {
Py_DECREF(scratch);
return -1; return -1;
}
kind = writer->kind; kind = writer->kind;
str = NULL; str = NULL;
} }
......
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