postgres.git / summary / log / commit / refs

commit    73a392d236965f14b84c0d09f011bda2cba6f8ca
Author:   Daniel Gustafsson <dgustafsson@postgresql.org>
Date:     Mon Dec 09 19:58:23 2024 +0000
First released in: 18.0, 16.7, 17.3

    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 <t.aliev@postgrespro.ru>
    Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
    Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
    Discussion: https://postgr.es/m/bba4313fdde9db46db279f96f3b748b1@postgrespro.ru
    Backpatch-through: 16


src/backend/commands/variable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 0ecff94d0ed..2c8059e8d89 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -1092,6 +1092,8 @@ check_application_name(char **newval, void **extra, GucSource source) return false; } + guc_free(*newval); + pfree(clean); *newval = ret; return true; @@ -1128,6 +1130,8 @@ check_cluster_name(char **newval, void **extra, GucSource source) return false; } + guc_free(*newval); + pfree(clean); *newval = ret; return true; [parent: 0a27c3d0f733]