postgres.git / summary / log / commit / refs
commit 9add1bbfa6659f45eb70f19961ce88973801b8ed
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 61eae295fa8..f92d72b5b7e 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;
[parent: 556f7b7bc18d]