Skip to content

Correctly deallocate memory in destroy_geom_box_tree#58

Merged
stevengj merged 1 commit intoNanoComp:masterfrom
ahoenselaar:patch-1
Sep 17, 2021
Merged

Correctly deallocate memory in destroy_geom_box_tree#58
stevengj merged 1 commit intoNanoComp:masterfrom
ahoenselaar:patch-1

Conversation

@ahoenselaar
Copy link
Contributor

If nobjects is zero, then MALLOC is still called during the construction of the tree. However, malloc implementations can choose to return a non-NULL pointer in that case and the returned pointer should be freed in order to prevent leaks: https://en.cppreference.com/w/c/memory/malloc

If `nobjects` is zero, then MALLOC is still called during the construction of the tree. However, `malloc` implementations can choose to return a non-NULL pointer in that case and the returned pointer should be freed in order to prevent leaks: https://en.cppreference.com/w/c/memory/malloc
@stevengj stevengj merged commit 21aff7e into NanoComp:master Sep 17, 2021
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