mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
vtysh: Cleanup memory leak
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>
This commit is contained in:
parent
c2270bf19d
commit
ab91425266
@ -348,9 +348,13 @@ void vtysh_config_parse_line(void *arg, const char *line)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (strncmp(line, "exit", strlen("exit")) == 0) {
|
if (strncmp(line, "exit", strlen("exit")) == 0) {
|
||||||
if (config)
|
if (config) {
|
||||||
|
if (config->exit)
|
||||||
|
XFREE(MTYPE_VTYSH_CONFIG_LINE,
|
||||||
|
config->exit);
|
||||||
config->exit =
|
config->exit =
|
||||||
XSTRDUP(MTYPE_VTYSH_CONFIG_LINE, line);
|
XSTRDUP(MTYPE_VTYSH_CONFIG_LINE, line);
|
||||||
|
}
|
||||||
} else if (strncmp(line, "interface", strlen("interface")) == 0)
|
} else if (strncmp(line, "interface", strlen("interface")) == 0)
|
||||||
config = config_get(INTERFACE_NODE, line);
|
config = config_get(INTERFACE_NODE, line);
|
||||||
else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
|
else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user