From a5c9e190beb444f70c83579d0e3a7f77435a73fa Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 26 Jun 2023 16:34:03 +0300 Subject: ldpd: Stop and free synchronous Zebra client on destroy Signed-off-by: Donatas Abraitis --- ldpd/ldp_zebra.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ldpd/ldp_zebra.c') 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; } -- cgit v1.2.3