Skip to content

fix: more CFE pointer initialization and cleanup...#154

Merged
aaraney merged 1 commit intoNOAA-OWP:masterfrom
hellkite500:pointer-initialization
Aug 6, 2025
Merged

fix: more CFE pointer initialization and cleanup...#154
aaraney merged 1 commit intoNOAA-OWP:masterfrom
hellkite500:pointer-initialization

Conversation

@hellkite500
Copy link
Contributor

Ensure soil and ground water reservoir pointer's (and the forcing_file...) are NULL initialized and properly freed.

Testing

  1. Run through clang address sanitizer and leak detector

@aaraney
Copy link
Member

aaraney commented Aug 6, 2025

Thanks for fixing this, @hellkite500! One more more down!

We should really setup one or more static analysis tools to run in CI and fail the build if there are warnings. I am finding similar issues in https://github.com/NOAA-OWP/evapotranspiration.

Copy link
Member

@aaraney aaraney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, @hellkite500!

cfe_bmi_data_ptr->gw_reservoir.coeff_secondary = 0.0; // 0.0 means that secondary outlet is not applied
cfe_bmi_data_ptr->gw_reservoir.exponent_secondary = 1.0; // linear

// Not used in gw reservoir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment, nothing to change. We should really move this and a lot of the code that directly precedes this into the init_soil_reservoir function that is called right after this. The initialization code is littered all over the place.

@aaraney aaraney merged commit a349a95 into NOAA-OWP:master Aug 6, 2025
4 checks passed
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