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 various issues found by valgrind #82

Merged
merged 9 commits into from
Feb 27, 2025
Merged

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Feb 27, 2025

No description provided.

Problem: In genders_handle_create() it manually cleans up on its
error path.

Call genders_handle_destroy() instead.
Problem: The list_append() wrapper returns GENDERS_ERR_INTERNAL
on error.  It should return a memory allocation error.

Return GENDERS_ERR_OUTMEM instead.
Problem: The comment header to _insert_attr() is not accurate.

Update the comment header accordingly.
Problem: A len parameter in _genders_open_and_parse() is not initialized
unless the file is > 0 in length.  It leads to valgrind warnings.

Initialize the len to 0.
Problem: Several temp hostlists are not destroyed during genders
query calculation.

Destroy those temporary hostlists.
Problem: In some tests lists (i.e. nodelist, attrlist) is not cleared
before a new test.  So lingering data could sit from a prior test.

Clear the lists before retesting.
Problem: Valgrind reports an initialization warning in the
testsuite.

Fix it and a related assert.
Problem: When testing genders_copy() the copy of the genders
handle was not destroyed at test completion.

Destroy the finished copy at test completion.
Problem: Valgrind reports memleaks on list creation tests.

Fix up the list creation leaks.
@chu11 chu11 merged commit 87877de into chaos:master Feb 27, 2025
1 check passed
@chu11 chu11 deleted the more_fixes branch February 27, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant