From: Daniel Gustafsson Date: Mon, 9 Dec 2024 19:58:23 +0000 (+0100) Subject: Fix small memory leaks in GUC checks X-Git-Tag: REL_16_7~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be9dac9afc25a1edaf4ad708b4efb909029b4198;p=thirdparty%2Fpostgresql.git Fix small memory leaks in GUC checks Follow-up commit to a9d58bfe8a3a. Backpatch down to v16 where this was added in order to keep the code consistent for future backpatches. Author: Tofig Aliev Reviewed-by: Daniel Gustafsson Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/bba4313fdde9db46db279f96f3b748b1@postgrespro.ru Backpatch-through: 16 --- diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index a81d236c6a9..8ea1fd9a63d 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -1082,6 +1082,8 @@ check_application_name(char **newval, void **extra, GucSource source) return false; } + guc_free(*newval); + pfree(clean); *newval = ret; return true; @@ -1118,6 +1120,8 @@ check_cluster_name(char **newval, void **extra, GucSource source) return false; } + guc_free(*newval); + pfree(clean); *newval = ret; return true;