Skip to content

compiler-rt/lib/profile/InstrProfilingFile.c:680:7: error: Resource leak #79708

Closed
@dcb314

Description

@dcb314

Source code is

if (CurrentFileOffset % PageSize != 0) {
  PROF_ERR("Continuous counter sync mode is enabled, but raw profile is not"
           "page-aligned. CurrentFileOffset = %" PRIu64 ", pagesz = %u.\n",
           (uint64_t)CurrentFileOffset, PageSize);
  return;
}
if (writeProfileWithFileObject(Filename, File) != 0) {
  fclose(File);
  return;
}

If it's worth calling fclose in the second if, then it is worthwhile in the first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions