summaryrefslogtreecommitdiff
path: root/ldpd/ldp_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-07-01 14:35:42 -0400
committerGitHub <noreply@github.com>2023-07-01 14:35:42 -0400
commit1f322e4cef0df7c736af7626ad7c9dc6f03e4bcc (patch)
tree2eec3cba264caeeced5f36152e1c8c4cf4e86c29 /ldpd/ldp_zebra.c
parent69a826c485bf6f79f39be372ef6a98aed2322ff9 (diff)
parenta5c9e190beb444f70c83579d0e3a7f77435a73fa (diff)
Merge pull request #13847 from opensourcerouting/fix/free_zclient_sync_on_destroy
Stop and free synchronous Zebra client on destroy
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;
}