aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/varbit.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-01-23 18:04:02 -0800
committerAndres Freund <andres@anarazel.de>2023-01-23 18:27:45 -0800
commit704a330a9ee882bebbe4abe44c9f174ceaaf2f69 (patch)
treea59f04f52e1fce6e99d778d7f419b802214d630a /src/backend/utils/adt/varbit.c
parent5dc582da6b9a281321e687ae2b52f96b929d8d0e (diff)
downloadpostgresql-704a330a9ee882bebbe4abe44c9f174ceaaf2f69.tar.gz
postgresql-704a330a9ee882bebbe4abe44c9f174ceaaf2f69.zip
Fix error handling in libpqrcv_connect()
When libpqrcv_connect (also known as walrcv_connect()) failed, it leaked the libpq connection. In most paths that's fairly harmless, as the calling process will exit soon after. But e.g. CREATE SUBSCRIPTION could lead to a somewhat longer lived leak. Fix by releasing resources, including the libpq connection, on error. Add a test exercising the error code path. To make it reliable and safe, the test tries to connect to port=-1, which happens to fail during connection establishment, rather than during connection string parsing. Reviewed-by: Noah Misch <noah@leadboat.com> Discussion: https://postgr.es/m/20230121011237.q52apbvlarfv6jm6@awork3.anarazel.de Backpatch: 11-
Diffstat (limited to 'src/backend/utils/adt/varbit.c')
0 files changed, 0 insertions, 0 deletions