summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-08-12 21:34:07 +0200
committerGitHub <noreply@github.com>2021-08-12 21:34:07 +0200
commita876da9b08efa0fcf6a311f8c58a60121b1da77f (patch)
tree45a5ccb2a9c481d44453b3feaac6b342e1ae79c6 /zebra
parentMerge pull request #9304 from donaldsharp/zebra_random_stuff (diff)
parentzebra: clean up nhg allocations in error path (diff)
downloadfrr-a876da9b08efa0fcf6a311f8c58a60121b1da77f.tar.xz
frr-a876da9b08efa0fcf6a311f8c58a60121b1da77f.zip
Merge pull request #9374 from mjstapp/fix_nhg_add_leak
zebra: clean up nhg allocations in error path
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zapi_msg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index f297bafaf..66208bfd8 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1937,6 +1937,11 @@ static void zread_nhg_add(ZAPI_HANDLER_ARGS)
flog_warn(EC_ZEBRA_NEXTHOP_CREATION_FAILED,
"%s: Nexthop Group Creation failed", __func__);
+
+ /* Free any local allocations */
+ nexthop_group_delete(&nhg);
+ zebra_nhg_backup_free(&bnhg);
+
return;
}