mirror of
https://github.com/python/cpython.git
synced 2026-04-22 20:01:13 +00:00
bpo-35454: Fix miscellaneous minor issues in error handling. (GH-11077)
* bpo-35454: Fix miscellaneous minor issues in error handling.
* Fix a null pointer dereference.
(cherry picked from commit 8905fcc85a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
3b9a0186c4
commit
62674f3a36
9 changed files with 44 additions and 23 deletions
|
|
@ -130,8 +130,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue