diff options
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r-- | psycopg/connection_int.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index 33df14a..b9d4484 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -152,9 +152,9 @@ conn_connect(connectionObject *self) return -1; } tmp = PQgetvalue(pgres, 0, 0); - self->encoding = PyMem_Malloc(strlen(tmp)+1); + self->encoding = malloc(strlen(tmp)+1); if (self->encoding == NULL) { - /* exception already set by PyMem_Malloc() */ + PyErr_NoMemory(); PQfinish(pgconn); IFCLEARPGRES(pgres); return -1; |