Fix PyUnicode_FromFormatV() error handling

Issue #28233: Fix a memory leak if the format string contains a non-ASCII
character, destroy the unicode writer.
This commit is contained in:
Victor Stinner 2016-09-21 14:13:14 +02:00
parent 0256f42839
commit 1ddf53d496

View file

@ -2719,7 +2719,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
"PyUnicode_FromFormatV() expects an ASCII-encoded format " "PyUnicode_FromFormatV() expects an ASCII-encoded format "
"string, got a non-ASCII byte: 0x%02x", "string, got a non-ASCII byte: 0x%02x",
(unsigned char)*p); (unsigned char)*p);
return NULL; goto fail;
} }
p++; p++;
} }