mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
fixed bug in connect.c
This commit is contained in:
parent
f09546fabf
commit
a8261182d2
@ -411,17 +411,6 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
|
|||||||
|
|
||||||
this->connection = PQsetdbLogin(host, port, options, NULL, realname, user, passwd);
|
this->connection = PQsetdbLogin(host, port, options, NULL, realname, user, passwd);
|
||||||
|
|
||||||
if (host)
|
|
||||||
free(host);
|
|
||||||
if (port)
|
|
||||||
free(port);
|
|
||||||
if (options)
|
|
||||||
free(options);
|
|
||||||
if (realname)
|
|
||||||
free(realname);
|
|
||||||
if (dbname)
|
|
||||||
free(dbname);
|
|
||||||
|
|
||||||
if (PQstatus(this->connection) == CONNECTION_BAD)
|
if (PQstatus(this->connection) == CONNECTION_BAD)
|
||||||
{
|
{
|
||||||
ecpg_finish(this);
|
ecpg_finish(this);
|
||||||
@ -433,9 +422,30 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
|
|||||||
user ? "for user " : "", user ? user : "",
|
user ? "for user " : "", user ? user : "",
|
||||||
lineno);
|
lineno);
|
||||||
ECPGraise(lineno, ECPG_CONNECT, realname ? realname : "<DEFAULT>");
|
ECPGraise(lineno, ECPG_CONNECT, realname ? realname : "<DEFAULT>");
|
||||||
|
if (host)
|
||||||
|
free(host);
|
||||||
|
if (port)
|
||||||
|
free(port);
|
||||||
|
if (options)
|
||||||
|
free(options);
|
||||||
|
if (realname)
|
||||||
|
free(realname);
|
||||||
|
if (dbname)
|
||||||
|
free(dbname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (host)
|
||||||
|
free(host);
|
||||||
|
if (port)
|
||||||
|
free(port);
|
||||||
|
if (options)
|
||||||
|
free(options);
|
||||||
|
if (realname)
|
||||||
|
free(realname);
|
||||||
|
if (dbname)
|
||||||
|
free(dbname);
|
||||||
|
|
||||||
this->committed = true;
|
this->committed = true;
|
||||||
this->autocommit = autocommit;
|
this->autocommit = autocommit;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user