-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zebra: clean up nhg allocations in error path #9374
Conversation
Clean up allocated nhgs in error path in zread_nhg_add(). Signed-off-by: Mark Stapp <[email protected]>
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zapi_read_nexthops
already takes care of this when it fails, or am I missing something?
I suppose what we actually should do is to remove those similar calls from zread_route_add
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a bit more involved (I think): zapi_read_nexthops
cleans up either the primary or backup nexthop object that it was working with. but I think if the primary call succeeded, then the backup call failed, in this path the primary object would be leaked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thanks!
🚧 Basic BGPD CI results: Partial FAILURE, autoscript-2021-08-11-11:18:14.log.bz2 tests failed, has VALGRIND issuesResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-21005/ This is a comment from an automated CI system. |
@Mergifyio backport stable/8.0 |
Command
|
zebra: clean up nhg allocations in error path (backport #9374)
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Clean up allocated nhgs in error path in zread_nhg_add().