summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-10-29 12:32:01 +0000
committerHeikki Linnakangas2014-10-29 12:34:43 +0000
commit8f8314b56003877185fb817c847c7c9609621d0c (patch)
tree08e298e9dd5acc5f46dd7a619f3b817fe39c5cfe
parenta00d468e658a245823083b9ac2e423a659a03802 (diff)
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 b0b0e1a643..3fe8c21639 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -2895,6 +2895,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;