-
Notifications
You must be signed in to change notification settings - Fork 190
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
fix leaks discovered via shell based tests #1380
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
We need to free the previous string, so use the r_replace_strdup helper. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
As the process exits shortly after returning from the affected functions, the leak didn't cause any problems. Fixing it makes the address sanitizer output more useful, though. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
So far, the RaucContext was not freed when called from main(). Before we can do that, we need to make sure that the g_autofree strings confpath, keyring and mount are not freed twice. Use g_steal_pointer to indicate that the context takes ownership. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This avoids some leak reports from address sanitizer, so that we can focus on real leaks. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
The RaucStatusPrint needs to free the memory it may have received from the service. In the non-service case, we need to copy or reference this data. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1380 +/- ##
==========================================
- Coverage 79.97% 79.96% -0.01%
==========================================
Files 67 67
Lines 20073 20073
==========================================
- Hits 16053 16052 -1
- Misses 4020 4021 +1 ☔ View full report in Codecov by Sentry. |
ejoerns
approved these changes
Apr 10, 2024
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.
Great work! 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
So far, we've only run the C-based test suite with address sanitized and fixed the resulting issues.
This PR fixes issues detected by running
./qemu-test
with a asan enabled and prepares for enabling these checks in CI as well.