pgpool2.git / summary / log / commit / refs
commit 4aa4fd7c099b1a8a35182c485bbbe03d74664a76
Author: Taiki Koshino <koshino@postgresql.org>
Date: Tue Oct 14 01:00:49 2025 +0000
Fix DelegateIPAssignMessage to properly handle delegate_IP as a char* using pfree() and pstrdup().
src/config/pool_config_variables.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c
index 326e3ab3f..50f0b0e03 100644
--- a/src/config/pool_config_variables.c
+++ b/src/config/pool_config_variables.c
@@ -4838,7 +4838,12 @@ DelegateIPAssignMessage(ConfigContext scontext, char *newval, int elevel)
ereport(WARNING,
(errmsg("delegate_IP is changed to delegate_ip"),
errdetail("if delegate_IP is specified, the value will be set to delegate_ip")));
- g_pool_config.delegate_ip = newval;
+ if (g_pool_config.delegate_ip)
+ pfree(g_pool_config.delegate_ip);
+ if (newval)
+ g_pool_config.delegate_ip = pstrdup(newval);
+ else
+ g_pool_config.delegate_ip = NULL;
return true;
}
[parent: b286ce29a071]