Fix tiny memory leaks

Tofig Aliev <t.aliev@postgrespro.ru>

From: Tofig Aliev <t.aliev@postgrespro.ru>
To: pgsql-hackers@lists.postgresql.org, sawada.mshk@gmail.com
Date: 2024-12-06T08:38:35Z
Lists: pgsql-hackers

Attachments

Hi, hackers!

There is a memory leak in functions check_application_name() and 
check_cluster_name().
Functions are located in src/backend/commands/variable.c

The leak can be triggered using SQL command: SET 
application_name=new_name;
You can run pgbench with this command for a long time by passing this 
command in file via '-f' flag.

regards,
Tofig

Commits

  1. Fix small memory leaks in GUC checks

  2. Fix tiny memory leaks