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

Commitaaf125f

Browse files
author
Michael Meskes
committed
Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>
1 parentb13c968 commitaaf125f

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,15 +1996,24 @@ Tu Feb 7 18:48:14 CET 2006
19961996

19971997
Fri, 17 Mar 2006 16:38:19 +0100
19981998

1999-
- Fixed bug 2330: Wrong error code in case of a duplicate key
1999+
- Fixed bug 2330: Wrong error code in case of a duplicate key.
20002000

20012001
Mo Apr 24 11:40:05 CEST 2006
20022002

20032003
- Fixed memory leak bugs found by Martijn Oosterhout.
20042004

2005-
Mi Mai 31 10:10:36 CEST 2006
2005+
We Mai 31 10:10:36 CEST 2006
20062006

2007-
- Fixed PGTYPESdate_from_timestamp because some characters got lost there
2007+
- Fixed PGTYPESdate_from_timestamp because some characters got lost there.
2008+
2009+
Tu Jun 6 12:09:56 CEST 2006
2010+
2011+
- Fixed two more memory leaks in ecpglib.
2012+
- Synced parser.
2013+
2014+
Mo Jun 19 11:15:50 CEST 2006
2015+
2016+
- Do not use already free'ed errmsg, bug found by Joachim Wieland
2017+
<joachim.wieland@credativ.de>
20082018
- Set ecpg library version to 5.2.
20092019
- Set ecpg version to 4.2.1.
2010-

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.27 2005/11/30 12:49:49 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.28 2006/06/19 09:19:49 meskes Exp $ */
22

33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
@@ -456,10 +456,6 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
456456
constchar*errmsg=PQerrorMessage(this->connection);
457457
char*db=realname ?realname :"<DEFAULT>";
458458

459-
ecpg_finish(this);
460-
#ifdefENABLE_THREAD_SAFETY
461-
pthread_mutex_unlock(&connections_mutex);
462-
#endif
463459
ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n",
464460
db,
465461
host ?host :"<DEFAULT>",
@@ -468,6 +464,11 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
468464
user ?"for user " :"",user ?user :"",
469465
lineno,errmsg);
470466

467+
ecpg_finish(this);
468+
#ifdefENABLE_THREAD_SAFETY
469+
pthread_mutex_unlock(&connections_mutex);
470+
#endif
471+
471472
ECPGraise(lineno,ECPG_CONNECT,ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION,db);
472473
if (host)
473474
ECPGfree(host);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp