From: Heikki Linnakangas Date: Wed, 29 Oct 2014 12:32:01 +0000 (+0200) Subject: Reset error message at PQreset() X-Git-Tag: REL9_1_15~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f7bd8e91da321cb38f09087a4b9411277917b13;p=postgresql 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. --- diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 472381f96a..1a3a6b237a 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 and curTuple */ + resetPQExpBuffer(&conn->errorMessage); pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist); conn->addrlist = NULL; conn->addr_cur = NULL;