ripd, ripngd: Free up list after call into nb_cli_rpc

We have a clear memory leak after running `clear ip rip`
Fix this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-12-12 18:48:04 -05:00
parent 297def9386
commit 0783b36d0e
2 changed files with 12 additions and 2 deletions

View File

@ -1001,6 +1001,7 @@ DEFPY (clear_ip_rip,
VRF_CMD_HELP_STR)
{
struct list *input;
int ret;
input = list_new();
if (vrf) {
@ -1011,7 +1012,11 @@ DEFPY (clear_ip_rip,
listnode_add(input, yang_vrf);
}
return nb_cli_rpc("/frr-ripd:clear-rip-route", input, NULL);
ret = nb_cli_rpc("/frr-ripd:clear-rip-route", input, NULL);
list_delete(&input);
return ret;
}
void rip_cli_init(void)

View File

@ -485,6 +485,7 @@ DEFPY (clear_ipv6_rip,
VRF_CMD_HELP_STR)
{
struct list *input;
int ret;
input = list_new();
if (vrf) {
@ -495,7 +496,11 @@ DEFPY (clear_ipv6_rip,
listnode_add(input, yang_vrf);
}
return nb_cli_rpc("/frr-ripngd:clear-ripng-route", input, NULL);
ret = nb_cli_rpc("/frr-ripngd:clear-ripng-route", input, NULL);
list_delete(&input);
return ret;
}
void ripng_cli_init(void)