-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add extra safe-guard to pointer allocation when a pointer is passed as an argument #1107
base: main
Are you sure you want to change the base?
Conversation
Is this only for mpp_io? |
@uramirez8707 @mcallic2 should these routines just be removed? They are named with |
I don't think those routines are actually related to mpp_io. |
The |
Yea, what Uriel said lol. Best not to remove anything, that is why we ifdef'd the old io out |
Description
This update relates to checking state of a pointer passed as an argument before reallocating it. In particular, the pointer argument, 'bc_rest_files', is passed into subroutines 'CT_register_restarts_2d', 'CT_register_restarts_3d', 'mpp_io_CT_register_restarts_2d', and 'mpp_io_CT_register_restarts_3d' but its state is unknown. In order to avoid multiple allocations without freeing, checks are added before reallocation.
Fixes #1099
How Has This Been Tested?
The update was tested with 'make check' and 'make distcheck' without any issues on OS, 'CentOS Stream 8'. The following setup was used for compiler, MPI wrapper, and required packages:
Checklist:
make distcheck
passes