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

NULLing on free #593

Closed
engelmi opened this issue Oct 4, 2023 · 0 comments · Fixed by #629
Closed

NULLing on free #593

engelmi opened this issue Oct 4, 2023 · 0 comments · Fixed by #629
Labels
enhancement New feature or request

Comments

@engelmi
Copy link
Member

engelmi commented Oct 4, 2023

In order to improve code quality, it's a good practice to set pointer variables to NULL after a free(...) has been applied. Among other benefits, applying this avoids dangling pointers (e.g. fixing a dangling pointer leading to an invalid read detected by valgrind: #592).

@engelmi engelmi added the enhancement New feature or request label Oct 4, 2023
engelmi added a commit that referenced this issue Nov 3, 2023
setting pointers to NULL after free

Signed-off-by: Michael Engel <mengel@redhat.com>
engelmi added a commit that referenced this issue Nov 8, 2023
setting pointers to NULL after free

Signed-off-by: Michael Engel <mengel@redhat.com>
engelmi added a commit that referenced this issue Nov 9, 2023
setting pointers to NULL after free

Signed-off-by: Michael Engel <mengel@redhat.com>
engelmi added a commit that referenced this issue Nov 9, 2023
setting pointers to NULL after free

Signed-off-by: Michael Engel <mengel@redhat.com>
engelmi added a commit that referenced this issue Nov 9, 2023
setting pointers to NULL after free

Signed-off-by: Michael Engel <mengel@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant