Fix tiny memory leaks
authorPeter Eisentraut <[email protected]>
Sat, 1 Oct 2022 10:48:24 +0000 (12:48 +0200)
committerPeter Eisentraut <[email protected]>
Sat, 1 Oct 2022 10:48:24 +0000 (12:48 +0200)
commita9d58bfe8a3ae2254e1553ab76974feeaafa0133
tree3e4d3673aebad22fcd75ba11f5d9b4a6e135e5fd
parent83e42a0035718914efad2fe04080fd6c579e9ef2
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 <[email protected]>
Reviewed-by: Jacob Champion <[email protected]>
Discussion: https://www.postgresql.org/message-id/CAD21AoBmFNy9MPfA0UUbMubQqH3AaK5U3mrv6pSeWrwCk3LJ8g@mail.gmail.com
src/backend/commands/variable.c