Skip to content

File not closed yet #532

@QiAnXinCodeSafe

Description

@QiAnXinCodeSafe

file open here

file = fopen(input_file.c_str(), "rb");

a 'fclose(file);' should be add here:

amber/samples/amber.cc

Lines 211 to 214 in 2585240

if (tell_file_size <= 0) {
std::cerr << "Input file of incorrect size: " << input_file << std::endl;
return {};
}

Even if it is just a sample, close the file when the file pointer is not used as a better software engineering perspective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions