From 40ab41115dd415cc42e311a96d66bb83ce4f1150 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Mon, 30 Nov 2020 18:44:10 +0300 Subject: [PATCH] vtysh: fix memory leak Signed-off-by: Igor Ryzhov --- vtysh/vtysh_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index 7dcf019888..f35a8af4b9 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -485,8 +485,10 @@ void vtysh_config_dump(void) * are not under the VRF node. */ if (config->index == INTERFACE_NODE - && list_isempty(config->line)) + && list_isempty(config->line)) { + config_del(config); continue; + } vty_out(vty, "%s\n", config->name); -- 2.39.5