summaryrefslogtreecommitdiff
path: root/ldpd/ldp_zebra.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-06-26 16:34:03 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-06-27 11:47:50 +0300
commita5c9e190beb444f70c83579d0e3a7f77435a73fa (patch)
tree3904d75bdb932d61054da26899525b906dfdfc5f /ldpd/ldp_zebra.c
parent93ffc5a2fdaf82c4c458c2c4bbbb090b0e00e443 (diff)
ldpd: Stop and free synchronous Zebra client on destroy
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'ldpd/ldp_zebra.c')
-rw-r--r--ldpd/ldp_zebra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index 2010829035..0fd5d4613c 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -39,6 +39,7 @@ static int ldp_zebra_opaque_msg_handler(ZAPI_CALLBACK_ARGS);
static void ldp_sync_zebra_init(void);
static struct zclient *zclient;
+extern struct zclient *zclient_sync;
static bool zebra_registered = false;
static void
@@ -703,4 +704,10 @@ ldp_zebra_destroy(void)
zclient_stop(zclient);
zclient_free(zclient);
zclient = NULL;
+
+ if (zclient_sync == NULL)
+ return;
+ zclient_stop(zclient_sync);
+ zclient_free(zclient_sync);
+ zclient_sync = NULL;
}