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

Fixing potential nil pointer dereferences #12

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Fixing potential nil pointer dereferences #12

merged 1 commit into from
Aug 13, 2024

Conversation

derconno
Copy link
Collaborator

By deferring .Close() before doing error checking, it could have happened that Close() would be called on a nil pointer, resulting in a segfault. This was fixed by deferring the call AFTER checking for potential errors.

By deferring <some pointer>.Close() before doing error checking, it could have happened that Close() would be called on a nil pointer, resulting in a segfault. This was fixed by deferring the call AFTER checking for potential errors.
@derconno derconno merged commit dab6252 into master Aug 13, 2024
3 checks passed
@derconno derconno deleted the bugfixes branch August 13, 2024 16:01
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