Skip to content

Commit 45da693

Browse files
committed
Fix memory leak in connection string validation.
Introduced in commit c3afe8c. Discussion: https://postgr.es/m/066a65233d3cb4ea27a9e0778d2f1d0dc764b222.camel@j-davis.com Reviewed-by: Nathan Bossart, Tom Lane Backpatch-through: 16
1 parent 2f696d5 commit 45da693

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,15 @@ libpqrcv_check_conninfo(const char *conninfo, bool must_use_password)
284284
}
285285

286286
if (!uses_password)
287+
{
288+
/* malloc'd, so we must free it explicitly */
289+
PQconninfoFree(opts);
290+
287291
ereport(ERROR,
288292
(errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
289293
errmsg("password is required"),
290294
errdetail("Non-superusers must provide a password in the connection string.")));
295+
}
291296
}
292297

293298
PQconninfoFree(opts);

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