When multiple daemons report a exit line for the same
node, vtysh was just dropping the previous pointer.
Ensure that we free it first.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
break;
default:
if (strncmp(line, "exit", strlen("exit")) == 0) {
- if (config)
+ if (config) {
+ if (config->exit)
+ XFREE(MTYPE_VTYSH_CONFIG_LINE,
+ config->exit);
config->exit =
XSTRDUP(MTYPE_VTYSH_CONFIG_LINE, line);
+ }
} else if (strncmp(line, "interface", strlen("interface")) == 0)
config = config_get(INTERFACE_NODE, line);
else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)