mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Use the Python heap for conn->dsn
This commit is contained in:
parent
c63d623f65
commit
d36024dc1f
|
@ -1069,10 +1069,7 @@ connection_setup(connectionObject *self, const char *dsn, long int async)
|
||||||
self, async, Py_REFCNT(self)
|
self, async, Py_REFCNT(self)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!(self->dsn = strdup(dsn))) {
|
if (0 > psycopg_strdup(&self->dsn, dsn, 0)) { goto exit; }
|
||||||
PyErr_NoMemory();
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
if (!(self->notice_list = PyList_New(0))) { goto exit; }
|
if (!(self->notice_list = PyList_New(0))) { goto exit; }
|
||||||
if (!(self->notifies = PyList_New(0))) { goto exit; }
|
if (!(self->notifies = PyList_New(0))) { goto exit; }
|
||||||
self->async = async;
|
self->async = async;
|
||||||
|
@ -1135,7 +1132,7 @@ connection_dealloc(PyObject* obj)
|
||||||
|
|
||||||
conn_notice_clean(self);
|
conn_notice_clean(self);
|
||||||
|
|
||||||
if (self->dsn) free(self->dsn);
|
PyMem_Free(self->dsn);
|
||||||
PyMem_Free(self->encoding);
|
PyMem_Free(self->encoding);
|
||||||
PyMem_Free(self->codec);
|
PyMem_Free(self->codec);
|
||||||
if (self->critical) free(self->critical);
|
if (self->critical) free(self->critical);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user