Fixed possible NULL dereferencing in notice process

This commit is contained in:
Daniele Varrazzo 2012-02-24 10:50:49 +00:00
parent a6df55f4e3
commit 4ecfd48671

View File

@ -120,8 +120,16 @@ conn_notice_process(connectionObject *self)
/* Respect the order in which notices were produced, /* Respect the order in which notices were produced,
because in notice_list they are reversed (see ticket #9) */ because in notice_list they are reversed (see ticket #9) */
if (msg) {
PyList_Insert(self->notice_list, nnotices, msg); PyList_Insert(self->notice_list, nnotices, msg);
Py_DECREF(msg); Py_DECREF(msg);
}
else {
/* We don't really have a way to report errors, so gulp it.
* The function should only fail for out of memory, so we are
* likely going to die anyway. */
PyErr_Clear();
}
notice = notice->next; notice = notice->next;
} }