fixeria submitted this change.
vty: fix memleak in host_config_set()
Not only we call this function from vty_read_config_file(), but
also from config_write_file_cmd. Thus we leak memory when doing
'write file FILE' in the VTY.
Change-Id: I356818aae3addab6db39de9a625453b7435b7cc1
---
M src/vty/command.c
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/vty/command.c b/src/vty/command.c
index a3e0e36..1719690 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -4297,7 +4297,7 @@
/* Set config filename. Called from vty.c */
void host_config_set(const char *filename)
{
- host.config = talloc_strdup(tall_vty_cmd_ctx, filename);
+ osmo_talloc_replace_string(tall_vty_cmd_ctx, &host.config, filename);
}
const char *host_config_file(void)
To view, visit change 36616. To unsubscribe, or for help writing mail filters, visit settings.