]> git.proxmox.com Git - mirror_frr.git/commitdiff
ldpd: release all memory explicitly on exit
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 27 Jan 2017 22:01:35 +0000 (20:01 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 1 Feb 2017 14:48:06 +0000 (12:48 -0200)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/ldp_zebra.c
ldpd/ldpd.c
ldpd/ldpd.h

index 8e7c6e27f91ba265f4413de15c284ad65a5c723d..79c4f5b3778f8007559d1fd9cebb9913a0f6941c 100644 (file)
@@ -497,3 +497,11 @@ ldp_zebra_init(struct thread_master *master)
        zclient->redistribute_route_ipv6_add = ldp_zebra_read_route;
        zclient->redistribute_route_ipv6_del = ldp_zebra_read_route;
 }
+
+void
+ldp_zebra_destroy(void)
+{
+       zclient_stop(zclient);
+       zclient_free(zclient);
+       zclient = NULL;
+}
index 391e0133760af757f2cb460ea7710eb15b8c721f..c9f4e37eeef4320eae2f11659de3a85cfba068a5 100644 (file)
@@ -453,6 +453,15 @@ ldpd_shutdown(void)
        free(iev_lde);
 
        log_info("terminating");
+
+       vrf_terminate();
+       cmd_terminate();
+       vty_terminate();
+       ldp_zebra_destroy();
+       zprivs_terminate(&ldpd_privs);
+       thread_master_free(master);
+       closezlog(zlog_default);
+
        exit(0);
 }
 
index 4d575597ae41156ac402c25accd94a38870c4819..3f6d7ac569429247f66b474029c514280bd4a7f3 100644 (file)
@@ -694,7 +694,8 @@ int          sock_set_ipv6_mcast_loop(int);
 extern struct thread_master    *master;
 
 /* ldp_zebra.c */
-void           ldp_zebra_init(struct thread_master *);
+void            ldp_zebra_init(struct thread_master *);
+void            ldp_zebra_destroy(void);
 
 /* compatibility */
 #ifndef __OpenBSD__