diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-12-10 23:05:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 23:05:13 -0800 |
commit | 62674f3a36ec55f86a5f20ee028a37fbd549bd6c (patch) | |
tree | e0e54395611c4a6eca057ea673c2d515fe45cd3b /Modules/_threadmodule.c | |
parent | 3b9a0186c44d0c3e477c38fdc00203ec99aec912 (diff) | |
download | cpython-git-62674f3a36ec55f86a5f20ee028a37fbd549bd6c.tar.gz |
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 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r-- | Modules/_threadmodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 16d3191c62..2a6b8931d7 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -777,9 +777,11 @@ local_clear(localobject *self) for(tstate = PyInterpreterState_ThreadHead(tstate->interp); tstate; tstate = PyThreadState_Next(tstate)) - if (tstate->dict && - PyDict_GetItem(tstate->dict, self->key)) - PyDict_DelItem(tstate->dict, self->key); + if (tstate->dict && PyDict_GetItem(tstate->dict, self->key)) { + if (PyDict_DelItem(tstate->dict, self->key)) { + PyErr_Clear(); + } + } } return 0; } |