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

Fix freeing in a few places #2058

Closed
wants to merge 2 commits into from
Closed

Fix freeing in a few places #2058

wants to merge 2 commits into from

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Sep 10, 2024

What does this implement/fix?

For this PR I went through all free invocations I could find and fixed some. Mostly, only seldom (if at all) touched code only called on errors is affected. Not everything changed below is "bad" - this PR also fixes a few issues with potential memory leaks.

Most important is a fix preventing a possible crash when upgrading an old double-hashed v5 password to a the BALLOON based v6 password format.


Related issue or feature (if applicable): #2035

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

… there can be no double-free corruptions in the future. Instead, on trying to free a pointer which has already been free'd (or was never allocated!), we instead print a warning to the log file and continue normal operation

Signed-off-by: DL6ER <[email protected]>
@yubiuser
Copy link
Member

Superseded by #2059

@DL6ER DL6ER closed this Sep 10, 2024
@DL6ER DL6ER deleted the fix/free branch September 10, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants