Commit af930096 authored by Victor Stinner's avatar Victor Stinner

Fix PyUnicode_FromFormatV() error handling

Issue #28233: Fix a memory leak if the format string contains a non-ASCII
character, destroy the unicode writer.
parent a7e9fd1b
...@@ -2719,7 +2719,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) ...@@ -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++;
} }
......
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