bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)

* bpo-35454: Fix miscellaneous minor issues in error handling.

* Fix a null pointer dereference.
This commit is contained in:
Serhiy Storchaka 2018-12-11 08:38:03 +02:00 committed by GitHub
parent bb86bf4c4e
commit 8905fcc85a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 44 additions and 23 deletions

View file

@ -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);