summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-11 06:38:03 (GMT)
committerGitHub <noreply@github.com>2018-12-11 06:38:03 (GMT)
commit8905fcc85a6fc3ac394bc89b0bbf40897e9497a6 (patch)
tree5b7afcdceab6dae37e3db90f952c5c76fe46b5cf /Modules/_threadmodule.c
parentbb86bf4c4eaa30b1f5192dab9f389ce0bb61114d (diff)
downloadcpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.zip
cpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.gz
cpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.bz2
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 'Modules/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index d075ef7..aacce69 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;
}