mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-23 01:16:34 +03:00
Fixed possible NULL dereferencing in notice process
This commit is contained in:
parent
a6df55f4e3
commit
4ecfd48671
|
@ -120,8 +120,16 @@ conn_notice_process(connectionObject *self)
|
|||
|
||||
/* Respect the order in which notices were produced,
|
||||
because in notice_list they are reversed (see ticket #9) */
|
||||
PyList_Insert(self->notice_list, nnotices, msg);
|
||||
Py_DECREF(msg);
|
||||
if (msg) {
|
||||
PyList_Insert(self->notice_list, nnotices, 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user