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:39:10 +0200
commit1a27fbd075e8671e0f8a98b3f12b35e86c41109b (patch)
treee4b9504193bde7fc0bfca86d9c448fa11bf5ede8
parent604d94d4cacc787bfa41452785a2927c24829fc5 (diff)
downloadpostgresql-1a27fbd075e8671e0f8a98b3f12b35e86c41109b.tar.gz
postgresql-1a27fbd075e8671e0f8a98b3f12b35e86c41109b.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 98d2c60b31c..8088bdac983 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -2944,6 +2944,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;