Skip to content
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

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

mjstapp
Copy link
Contributor

@mjstapp mjstapp commented Aug 11, 2021

Clean up allocated nhgs in error path in zread_nhg_add().

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thanks!

@LabN-CI
Copy link
Collaborator

LabN-CI commented Aug 11, 2021

🚧 Basic BGPD CI results: Partial FAILURE, autoscript-2021-08-11-11:18:14.log.bz2 tests failed, has VALGRIND issues

Results table
_ _
Result SUCCESS git merge/9374 fd99142
Date 08/11/2021
Start 11:17:03
Finish 11:42:39
Run-Time 25:36
Total 1813
Pass 1813
Fail 0
Details vncregress-2021-08-11-11:17:03.txt
Log autoscript-2021-08-11-11:18:14.log.bz2
Memory 517 509 426

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp donaldsharp merged commit a876da9 into FRRouting:master Aug 12, 2021
@idryzhov
Copy link
Contributor

@Mergifyio backport stable/8.0

@mergify
Copy link

mergify bot commented Aug 12, 2021

Command backport stable/8.0: success

Backports have been created

idryzhov added a commit that referenced this pull request Aug 13, 2021
zebra: clean up nhg allocations in error path (backport #9374)
@LabN-CI
Copy link
Collaborator

LabN-CI commented Aug 13, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/9374 fd99142
Date 08/11/2021
Start 11:17:03
Finish 11:42:39
Run-Time 25:36
Total 1813
Pass 1813
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-08-11-11:17:03.txt
Log autoscript-2021-08-11-11:18:14.log.bz2
Memory 517 509 426

For details, please contact louberger

@mjstapp mjstapp deleted the fix_nhg_add_leak branch November 17, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants