diff options
| author | Noam Cohen <noam@noam.me> | 2022-07-26 14:34:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-26 14:34:15 +0300 |
| commit | b1f648efc56ff17e18ec2b7402d59a771b305004 (patch) | |
| tree | b44b841c41e9ea0d9ecd3d80cbc7d465ac36021d /Modules | |
| parent | a5dde0fe4fa13b4ccfec4e27502b19bbbb7e5bb0 (diff) | |
| download | cpython-git-b1f648efc56ff17e18ec2b7402d59a771b305004.tar.gz | |
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails (GH-95264)
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/syslogmodule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index 27b176aeb6..c409fe968f 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -191,8 +191,14 @@ syslog_syslog(PyObject * self, PyObject * args) */ if ((openargs = PyTuple_New(0))) { PyObject *openlog_ret = syslog_openlog(self, openargs, NULL); - Py_XDECREF(openlog_ret); Py_DECREF(openargs); + if (openlog_ret == NULL) { + return NULL; + } + Py_DECREF(openlog_ret); + } + else { + return NULL; } } |
