]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: Fixing memory leak issue
authorrgirada <rgirada@vmware.com>
Sun, 8 Mar 2020 01:22:52 +0000 (17:22 -0800)
committerrgirada <rgirada@vmware.com>
Sun, 8 Mar 2020 01:22:52 +0000 (17:22 -0800)
Memory allotted for staticd specific vrf structers is not
being deallocated when the corresponding vrf is destroyed.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
staticd/static_main.c
staticd/static_vrf.c
staticd/static_vrf.h

index 43cb7db51dfd1823ba8deae95823fe4303d12a4d..3aa8a8db3ebb7c7dfa7246226cb16285cea5e09e 100644 (file)
@@ -73,6 +73,8 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
 
+       static_vrf_terminate();
+
        exit(0);
 }
 
index abb64aad3f34b04641afe654c1f92b3eb6953ea5..6c065932a10a4757fcc519932edc97bbd874fbe3 100644 (file)
@@ -111,6 +111,7 @@ static int static_vrf_delete(struct vrf *vrf)
                        svrf->stable[afi][safi] = NULL;
                }
        }
+       XFREE(MTYPE_TMP, svrf);
        return 0;
 }
 
@@ -204,3 +205,8 @@ void static_vrf_init(void)
 
        vrf_cmd_init(static_vrf_config_write, &static_privs);
 }
+
+void static_vrf_terminate(void)
+{
+       vrf_terminate();
+}
index 28fcdd0d36ac068bc273ea3db052b80986950e18..6951e56712f56f7ec61a28903d85b39b6570758a 100644 (file)
@@ -35,4 +35,5 @@ void static_vrf_init(void);
 
 struct route_table *static_vrf_static_table(afi_t afi, safi_t safi,
                                            struct static_vrf *svrf);
+extern void static_vrf_terminate(void);
 #endif