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

dfilemaker: pass correct pointer to mfu_free() #609

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

ofaaland
Copy link
Collaborator

Commit
commit fc70c2c
Author: Olaf Faaland faaland1@llnl.gov
Date: Thu Nov 14 15:44:34 2024 -0800

dfilemaker: address review comments for PR #269

introduced an error. mfu_free() takes a pointer to a pointer, because it both frees the memory, and also sets the pointer to NULL to prevent double-free bugs.

The above commit passed the address of the memory to be freed, not the address of the pointer. This meant both that the wrong memory was freed, potentially, and also that the code attempted to set some arbitrary set of bytes to NULL.

In testing, this triggered a segfault when running dfilemaker.

Commit
	commit fc70c2c
	Author: Olaf Faaland <faaland1@llnl.gov>
	Date:   Thu Nov 14 15:44:34 2024 -0800

	dfilemaker: address review comments for PR hpc#269

introduced an error.  mfu_free() takes a pointer to a pointer,
because it both frees the memory, and also sets the pointer to
NULL to prevent double-free bugs.

The above commit passed the address of the memory to be freed,
not the address of the pointer.  This meant both that the
wrong memory was freed, potentially, and also that the code
attempted to set some arbitrary set of bytes to NULL.

In testing, this triggered a segfault when running dfilemaker.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
@ofaaland ofaaland self-assigned this Nov 25, 2024
@ofaaland ofaaland requested a review from carbonneau1 November 25, 2024 23:38
carbonneau1
carbonneau1 approved these changes Nov 25, 2024
@ofaaland ofaaland merged commit e302e19 into hpc:main Nov 25, 2024
@ofaaland ofaaland deleted the b-dfilemaker-free branch December 3, 2024 21:52
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.

2 participants