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.

Activity

added a commit that references this issue on Feb 10, 2024
adbc55e
added a commit that references this issue on Feb 10, 2024
0a255fc
devnexen

devnexen commented on Feb 10, 2024

@devnexen
Member

Thanks @dcb314 for reporting

added a commit that references this issue on Feb 11, 2024
9d41797
added a commit that references this issue on Feb 20, 2024
390dcd4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @dcb314@devnexen@EugeneZelenko

      Issue actions

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