diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-11 07:27:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 07:27:50 (GMT) |
commit | 8855d9339858683c9b4fcd50b02a7bca526d4726 (patch) | |
tree | 3c85fc696f92556807f1031f9653ed3b73d70561 /Python/codecs.c | |
parent | 37607f26697351751165a042f91f04530ce333f7 (diff) | |
download | cpython-8855d9339858683c9b4fcd50b02a7bca526d4726.zip cpython-8855d9339858683c9b4fcd50b02a7bca526d4726.tar.gz cpython-8855d9339858683c9b4fcd50b02a7bca526d4726.tar.bz2 |
[3.6] bpo-35454: Fix miscellaneous minor issues in error handling. (GH-11077) (GH-11106)
(cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
Diffstat (limited to 'Python/codecs.c')
-rw-r--r-- | Python/codecs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 4ff8301..584c1ef 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -129,8 +129,10 @@ PyObject *_PyCodec_Lookup(const char *encoding) /* Next, scan the search functions in order of registration */ args = PyTuple_New(1); - if (args == NULL) - goto onError; + if (args == NULL) { + Py_DECREF(v); + return NULL; + } PyTuple_SET_ITEM(args,0,v); len = PyList_Size(interp->codec_search_path); |