Skip to content

Commit 1325b23

Browse files
committed
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.
1 parent 1aa526f commit 1325b23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ closePGconn(PGconn *conn)
29092909
* absent */
29102910
conn->asyncStatus = PGASYNC_IDLE;
29112911
pqClearAsyncResult(conn); /* deallocate result */
2912+
resetPQExpBuffer(&conn->errorMessage);
29122913
pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
29132914
conn->addrlist = NULL;
29142915
conn->addr_cur = NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy