From: Mark Stapp Date: Wed, 11 Aug 2021 14:41:53 +0000 (-0400) Subject: zebra: clean up nhg allocations in error path X-Git-Tag: base_8.1~207^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fd99142ab79e265840ebb1990d4348dfcf47de14;p=matthieu%2Ffrr.git zebra: clean up nhg allocations in error path Clean up allocated nhgs in error path in zread_nhg_add(). Signed-off-by: Mark Stapp --- diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 27fb5d7c22..b16128cea7 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; }