summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-21 12:13:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-21 12:13:14 (GMT)
commit1ddf53d496a3b7bd09fe8672daa2f07a4d240f2c (patch)
treeb75f349762f163bf5106138179013871195e1841 /Objects/unicodeobject.c
parent0256f4283987276796129b09905e71a7e3c590d3 (diff)
downloadcpython-1ddf53d496a3b7bd09fe8672daa2f07a4d240f2c.zip
cpython-1ddf53d496a3b7bd09fe8672daa2f07a4d240f2c.tar.gz
cpython-1ddf53d496a3b7bd09fe8672daa2f07a4d240f2c.tar.bz2
Fix PyUnicode_FromFormatV() error handling
Issue #28233: Fix a memory leak if the format string contains a non-ASCII character, destroy the unicode writer.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index af04564..176ec13 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2719,7 +2719,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
"PyUnicode_FromFormatV() expects an ASCII-encoded format "
"string, got a non-ASCII byte: 0x%02x",
(unsigned char)*p);
- return NULL;
+ goto fail;
}
p++;
}