Skip to content

Commit b1f648e

Browse files
authored
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails (GH-95264)
1 parent a5dde0f commit b1f648e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Modules/syslogmodule.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,14 @@ syslog_syslog(PyObject * self, PyObject * args)
191191
*/
192192
if ((openargs = PyTuple_New(0))) {
193193
PyObject *openlog_ret = syslog_openlog(self, openargs, NULL);
194-
Py_XDECREF(openlog_ret);
195194
Py_DECREF(openargs);
195+
if (openlog_ret == NULL) {
196+
return NULL;
197+
}
198+
Py_DECREF(openlog_ret);
199+
}
200+
else {
201+
return NULL;
196202
}
197203
}
198204

0 commit comments

Comments
 (0)