Skip to content

Commit 8210ab3

Browse files
committed
gh-95041: fail syslog.syslog in case inner call to syslog.openlog fails
1 parent 5012bed commit 8210ab3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/syslogmodule.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ 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+
Py_XDECREF(openlog_ret);
196+
if (openlog_ret == NULL) {
197+
return NULL;
198+
}
196199
}
197200
}
198201

0 commit comments

Comments
 (0)