diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-11 08:38:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 08:38:03 +0200 |
commit | 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6 (patch) | |
tree | 5b7afcdceab6dae37e3db90f952c5c76fe46b5cf /Python/codecs.c | |
parent | bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d (diff) | |
download | cpython-git-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.gz |
bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)
* bpo-35454: Fix miscellaneous minor issues in error handling.
* Fix a null pointer dereference.
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 002fad3080..ff2142df40 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); |