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

Fix memory leak from cellLimitField in mpas_block_creator_build_cell_halos #1264

Open
wants to merge 1 commit into
base: hotfix-v8.2.3
Choose a base branch
from

Conversation

mgduda
Copy link
Contributor

@mgduda mgduda commented Jan 10, 2025

This PR fixes a memory leak in mpas_block_creator_build_cell_halos by deallocating the cellLimitField field before the routine returns.

The cellLimitField field is allocated in the mpas_block_creator_build_cell_halos routine and is only used in a call therein to mpas_dmpar_get_exch_list. If not deallocated at the end of the mpas_block_creator_build_cell_halos routine, the memory allocated to cellLimitField would be otherwise be leaked, since there is nothing outisde of the mpas_block_creator_build_cell_halos routine that retains a reference to it and deallocates it.

…halos

The cellLimitField field is allocated in the mpas_block_creator_build_cell_halos
routine and is only used in a call therein to mpas_dmpar_get_exch_list. If not
deallocated at the end of the mpas_block_creator_build_cell_halos routine, the
memory allocated to cellLimitField would be otherwise be leaked, since there
is nothing outisde of the mpas_block_creator_build_cell_halos routine that
retains a reference to it and deallocates it.

This commit fixes this memory leak by deallocating cellLimitField before the
mpas_block_creator_build_cell_halos routine returns.
@mgduda mgduda force-pushed the framework/fix_cellLimitField_leak branch from 2384910 to 90f7ecc Compare January 10, 2025 21:01
@mgduda mgduda requested a review from abishekg7 January 10, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant