Skip to content

Commit 9813348

Browse files
committed
avoid using a pointer to freed memory on syslog.syslog
1 parent c95b55c commit 9813348

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Modules/syslogmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ syslog_syslog(PyObject * self, PyObject * args)
192192
if ((openargs = PyTuple_New(0))) {
193193
PyObject *openlog_ret = syslog_openlog(self, openargs, NULL);
194194
Py_DECREF(openargs);
195-
Py_XDECREF(openlog_ret);
196-
if (openlog_ret == NULL) {
195+
if (openlog_ret != NULL) {
196+
Py_DECREF(openlog_ret);
197+
} else {
197198
return NULL;
198199
}
199200
} else {

0 commit comments

Comments
 (0)