fix: pedantic memory leak in handshake test #4463
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We run valgrind with "pedantic" settings, which requires that memory in child processes is explicitly freed before the process exits. This is commonly an issue when defer cleanup is used, because defer cleanup statements are not invoked when the "exit" system call is used.
Description of changes:
#4369 merges in CI changes to catch these errors, but
s2n_handshake_test
was modified in between when I opened the PR and when I tried to merge the PR. After rebasing on main, this is now causing failures for my PR.This PR fixes the new failures in
s2n_handshake_test
separately from #4369 to make review easier.Testing:
failing run for current mainline build with my valgrind changes:here
(Initial draft): passing run of this change with my valgrind changes rebased on top of it: here
(nested scope): here
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.