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

avoid possible double frees #4

Merged
merged 3 commits into from
Jan 5, 2024
Merged

avoid possible double frees #4

merged 3 commits into from
Jan 5, 2024

Conversation

zshipko
Copy link
Owner

@zshipko zshipko commented Jan 4, 2024

Fixes #3 by adding a field to track if free has already been called

@athas
Copy link

athas commented Jan 5, 2024

A useful addition would also be to check this field whenever the array is used. Then use-after-free errors would result in a sensible OCaml exception rather than a segfault.

@zshipko
Copy link
Owner Author

zshipko commented Jan 5, 2024

Thanks for the suggestion @athas, I've added some additional checks

@zshipko zshipko merged commit 98b520d into main Jan 5, 2024
5 checks passed
@zshipko zshipko deleted the fix-double-free branch January 5, 2024 17:57
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.

Question - Do we need to call the free function in OCaml?
2 participants