Skip to content

Commit

Permalink
pythongh-95041: Fail syslog.syslog in case inner call to syslog.openl…
Browse files Browse the repository at this point in the history
…og fails (pythonGH-95264)
  • Loading branch information
noamcohen97 authored Jul 26, 2022
1 parent a5dde0f commit b1f648e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Modules/syslogmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit b1f648e

Please sign in to comment.