Skip to content

Directories aren't closed in 'Formulation_Manager::get_forcing_params` #923

@christophertubbs

Description

@christophertubbs

There are two return statements in Formulation_Manager::get_forcing_params that don't call closedir before exiting the function. closedir should probably be called after the forcing object is created and before returning or an RAII object should be created to wrap the directory object to ensure it is always closed when exiting scope.

Failing to address this may result in file handle leaks.

NOTE: I'm obviously not the C++ expert here, so this can probably be closed outright if there's something non-obvious that performs the clean up. If that's the case, though, a nice comment may be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions