mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
* psycopg/connection_int.c (conn_notice_callback): don't leak
notice messages.
This commit is contained in:
parent
8103f44a12
commit
af1478feb9
|
@ -1,3 +1,8 @@
|
|||
2008-03-19 James Henstridge <james@jamesh.id.au>
|
||||
|
||||
* psycopg/connection_int.c (conn_notice_callback): don't leak
|
||||
notice messages.
|
||||
|
||||
2008-03-17 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/adapter_datetime.c: fixed double decref when using
|
||||
|
|
|
@ -46,7 +46,10 @@ conn_notice_callback(void *args, const char *message)
|
|||
if (self->protocol < 3 && strncmp(message, "ERROR", 5) == 0)
|
||||
pq_set_critical(self, message);
|
||||
else {
|
||||
PyList_Append(self->notice_list, PyString_FromString(message));
|
||||
PyObject *msg = PyString_FromString(message);
|
||||
|
||||
PyList_Append(self->notice_list, msg);
|
||||
Py_DECREF(msg);
|
||||
|
||||
/* Remove the oldest item if the queue is getting too long. */
|
||||
if (PyList_GET_SIZE(self->notice_list) > CONN_NOTICES_LIMIT)
|
||||
|
|
Loading…
Reference in New Issue
Block a user