pgsql: Fix tiny memory leaks

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix tiny memory leaks
Date: 2022-10-01 10:52:05
Message-ID: E1oea6G-000Q0j-HW@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix tiny memory leaks

Both check_application_name() and check_cluster_name() use
pg_clean_ascii() but didn't release the memory. Depending on when the
GUC is set, this might be cleaned up at some later time or it would
leak postmaster memory once. In any case, it seems better not to have
to rely on such analysis and make the code locally robust. Also, this
makes Valgrind happier.

Author: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Reviewed-by: Jacob Champion <jchampion(at)timescale(dot)com>
Discussion: https://www.postgresql.org/message-id/CAD21AoBmFNy9MPfA0UUbMubQqH3AaK5U3mrv6pSeWrwCk3LJ8g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a9d58bfe8a3ae2254e1553ab76974feeaafa0133

Modified Files
--------------
src/backend/commands/variable.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2022-10-01 16:35:31 Re: pgsql: Avoid improbable PANIC during heap_update.
Previous Message Michael Paquier 2022-10-01 06:28:43 pgsql: doc: Fix some grammar and typos