mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-23 01:16:34 +03:00
Fixed string allocation (loses: #109)
This commit is contained in:
parent
caa9d0feb4
commit
fb0b523586
|
@ -1,3 +1,8 @@
|
||||||
|
2006-06-11 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
|
* Applied patch from wkv to avoid off by one allocation of
|
||||||
|
connection encoding string (Closes: #109).
|
||||||
|
|
||||||
2006-06-09 Federico Di Gregorio <fog@initd.org>
|
2006-06-09 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
* Release 2.0.1.
|
* Release 2.0.1.
|
||||||
|
|
|
@ -112,7 +112,7 @@ conn_connect(connectionObject *self)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
tmp = PQgetvalue(pgres, 0, 0);
|
tmp = PQgetvalue(pgres, 0, 0);
|
||||||
self->encoding = PyMem_Malloc(strlen(tmp));
|
self->encoding = PyMem_Malloc(strlen(tmp)+1);
|
||||||
if (self->encoding == NULL) {
|
if (self->encoding == NULL) {
|
||||||
/* exception already set by PyMem_Malloc() */
|
/* exception already set by PyMem_Malloc() */
|
||||||
PQfinish(pgconn);
|
PQfinish(pgconn);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user