summaryrefslogtreecommitdiff
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-03-22 01:24:34 -0600
committerSerhiy Storchaka <storchaka@gmail.com>2019-03-22 09:24:34 +0200
commit93e8012f2cabd84f30b52e19fd3dc557efa9f8af (patch)
tree14a35ffb5655903a9ca74571996c604f5debe4a2 /Objects/structseq.c
parent9a0000d15d27361eaa47b77600c7c00a9787a894 (diff)
downloadcpython-git-93e8012f2cabd84f30b52e19fd3dc557efa9f8af.tar.gz
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.
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 5278313ffd..cf36fa7f97 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -176,7 +176,7 @@ structseq_repr(PyStructSequence *obj)
strlen(typ->tp_name),
NULL);
if (type_name == NULL) {
- goto error;
+ return NULL;
}
_PyUnicodeWriter_Init(&writer);