aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-10-29 14:32:01 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-10-29 14:41:32 +0200
commitfcca871203568a4d34bc026029bee51e8d246ae2 (patch)
treee974d98376ee211b38f710a1403109b48e560455
parentd1f8e7a01501c71db3ee0bcd19aab79b1ddc662e (diff)
downloadpostgresql-fcca871203568a4d34bc026029bee51e8d246ae2.tar.gz
postgresql-fcca871203568a4d34bc026029bee51e8d246ae2.zip
Reset error message at PQreset()
If you call PQreset() repeatedly, and the connection cannot be re-established, the error messages from the failed connection attempts kept accumulating in the error string. Fixes bug #11455 reported by Caleb Epstein. Backpatch to all supported versions.
-rw-r--r--src/interfaces/libpq/fe-connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 540426cbe96..2dd244972a9 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -2894,6 +2894,7 @@ closePGconn(PGconn *conn)
* absent */
conn->asyncStatus = PGASYNC_IDLE;
pqClearAsyncResult(conn); /* deallocate result */
+ resetPQExpBuffer(&conn->errorMessage);
pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
conn->addrlist = NULL;
conn->addr_cur = NULL;