8000 gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails by noamcohen97 · Pull Request #95264 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails #95264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
avoid using a pointer to freed memory on syslog.syslog
  • Loading branch information
noamcohen97 committed Jul 26, 2022
commit 98133481dcd2c9da6739fedcea00ca173b6621aa
5 changes: 3 additions & 2 deletions Modules/syslogmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ syslog_syslog(PyObject * self, PyObject * args)
if ((openargs = PyTuple_New(0))) {
PyObject *openlog_ret = syslog_openlog(self, openargs, NULL);
Py_DECREF(openargs);
Py_XDECREF(openlog_ret);
if (openlog_ret == NULL) {
if (openlog_ret != NULL) {
Py_DECREF(openlog_ret);
} else {
return NULL;
}
} else {
Expand Down
0