aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-11 08:38:03 +0200
committerGitHub <noreply@github.com>2018-12-11 08:38:03 +0200
commit8905fcc85a6fc3ac394bc89b0bbf40897e9497a6 (patch)
tree5b7afcdceab6dae37e3db90f952c5c76fe46b5cf /Modules/socketmodule.c
parentbpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11... (diff)
downloadcpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.gz
cpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.bz2
cpython-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.zip
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/socketmodule.c')
-rw-r--r--Modules/socketmodule.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 40f1ca64a4a..73d3e1add3e 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -362,10 +362,14 @@ remove_unusable_flags(PyObject *m)
else {
if (PyDict_GetItemString(
dict,
- win_runtime_flags[i].flag_name) != NULL) {
- PyDict_DelItemString(
- dict,
- win_runtime_flags[i].flag_name);
+ win_runtime_flags[i].flag_name) != NULL)
+ {
+ if (PyDict_DelItemString(
+ dict,
+ win_runtime_flags[i].flag_name))
+ {
+ PyErr_Clear();
+ }
}
}
}