gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails (GH-95264)

This commit is contained in:
Noam Cohen 2022-07-26 14:34:15 +03:00 committed by GitHub
parent a5dde0fe4f
commit b1f648efc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}