pgsql: Don't leak malloc'd error string in libpqrcv_check_conninfo().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't leak malloc'd error string in libpqrcv_check_conninfo().
Date: 2021-03-19 02:23:41
Message-ID: E1lN4nd-0001of-Lp@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't leak malloc'd error string in libpqrcv_check_conninfo().

We leaked the error report from PQconninfoParse, when there was
one. It seems unlikely that real usage patterns would repeat
the failure often enough to create serious bloat, but let's
back-patch anyway to keep the code similar in all branches.

Found via valgrind testing.
Back-patch to v10 where this code was added.

Discussion: https://postgr.es/m/3816764.1616104288@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/20f11ca0dbc2bd99de9c4866eec6722b8202e422

Modified Files
--------------
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2021-03-19 02:30:13 pgsql: Fix comments in postmaster.c.
Previous Message Tomas Vondra 2021-03-19 01:17:52 pgsql: Fix TAP test for remove_temp_files_after_crash