Merged
Conversation
92d1d7d to
2145733
Compare
arogge
requested changes
May 17, 2024
Member
arogge
left a comment
There was a problem hiding this comment.
That is a huge improvement! How did you find all of these?
I have a few remarks. Nothing critical though.
Contributor
Author
|
I gathered all the logs created by asan with our test suite. |
b780ff7 to
1ae4aea
Compare
arogge
approved these changes
May 24, 2024
Member
arogge
left a comment
There was a problem hiding this comment.
The code looks great.
However, the new dbcheck test fails everywhere, so you'll have to take another look.
Member
|
Do you think we should backport some/all of these into 23? |
Contributor
Author
|
Ill try to backport it and ill see what works. |
30eea5b to
d220b39
Compare
PQfinish _always_ has to be called on db_handle_, if its not null: https://www.postgresql.org/docs/current/libpq-connect.html "Note that when PQconnectStart or PQconnectStartParams returns a non-null pointer, you must call PQfinish when you are finished with it, in order to dispose of the structure and any associated memory blocks. This must be done even if the connection attempt fails or is abandoned." PQexec() always allocates a new result object, that always has to be freed with PQclear()!
Instead of hunting down every place where this could get leaked, we instead use PoolMem to do so automatically.
Removing unecessary code since stifle_history() already ensures that we only have at most history_max_entries inside our history. Regardless this is a leak because remove_history returns to us a HIST_ENTRY* that we are supposed to free on our own (which we do not do!).
When an error occurs during the resource scanning, then the scanned resource is not added to any list, which means its memory is never freed. As such we free the allocated resource here but calling the appropriate callback.
e44b4e7 to
318258a
Compare
This file contains hidden or 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
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.
Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality
Tests