gh-129345: null check for indent syslogmodule (#129348)

This commit is contained in:
Burkov Egor 2025-01-29 16:49:23 +03:00 committed by GitHub
parent c67afb581e
commit 25cf79a082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix null pointer dereference in :func:`syslog.openlog` when an audit hook raises an exception.

View file

@ -176,7 +176,7 @@ syslog_openlog_impl(PyObject *module, PyObject *ident, long logopt,
}
}
if (PySys_Audit("syslog.openlog", "Oll", ident ? ident : Py_None, logopt, facility) < 0) {
Py_DECREF(ident);
Py_XDECREF(ident);
return NULL;
}