]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripd, ripngd: Free up list after call into nb_cli_rpc
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 12 Dec 2019 23:48:04 +0000 (18:48 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 12 Dec 2019 23:48:04 +0000 (18:48 -0500)
We have a clear memory leak after running `clear ip rip`
Fix this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ripd/rip_cli.c
ripngd/ripng_cli.c

index 5c26c0cef73ceec970471523e27f0762a62d0dba..7e2394f4732a5634fd8b14ee117c34ae3d316e89 100644 (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)
index 2d9930e3576d76a93f2d81f489e30a90e8b0c2fc..b3d92fb0d90337164d0ec56d89f6b37f13c4b122 100644 (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)