mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails (GH-95264)
(cherry picked from commit b1f648efc5
)
Co-authored-by: Noam Cohen <noam@noam.me>
This commit is contained in:
parent
202311c67a
commit
9640c4c88c
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue