Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita826118

Browse files
author
Michael Meskes
committed
fixed bug in connect.c
1 parentf09546f commita826118

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

‎src/interfaces/ecpg/lib/connect.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,6 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
411411

412412
this->connection=PQsetdbLogin(host,port,options,NULL,realname,user,passwd);
413413

414-
if (host)
415-
free(host);
416-
if (port)
417-
free(port);
418-
if (options)
419-
free(options);
420-
if (realname)
421-
free(realname);
422-
if (dbname)
423-
free(dbname);
424-
425414
if (PQstatus(this->connection)==CONNECTION_BAD)
426415
{
427416
ecpg_finish(this);
@@ -433,9 +422,30 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
433422
user ?"for user " :"",user ?user :"",
434423
lineno);
435424
ECPGraise(lineno,ECPG_CONNECT,realname ?realname :"<DEFAULT>");
425+
if (host)
426+
free(host);
427+
if (port)
428+
free(port);
429+
if (options)
430+
free(options);
431+
if (realname)
432+
free(realname);
433+
if (dbname)
434+
free(dbname);
436435
return false;
437436
}
438437

438+
if (host)
439+
free(host);
440+
if (port)
441+
free(port);
442+
if (options)
443+
free(options);
444+
if (realname)
445+
free(realname);
446+
if (dbname)
447+
free(dbname);
448+
439449
this->committed= true;
440450
this->autocommit=autocommit;
441451

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp