<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/79708>79708</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            compiler-rt/lib/profile/InstrProfilingFile.c:680:7: error: Resource leak
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    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.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU82SozYQfprm0mUKmv8DB68dqua0Lu8hxy0BDSiRJZck1jXz9CmBJ5NJ5hIfZEHz_fTXknBOzpq5heIbFOdIrH4xth2HPkvzqDfja_vDrHZgHMzIKB0kZ0iO-4qIKCcEqk-rtax9JxV_nybHHoEKvIiZf8g3RqAUsjMmQA1C9e0DjXi5fu9-_na9AtVAdDLaS72a1eFgVu3ZonvVA952cWQtesUj0An71aMVD7xbM0m1VbXxQPRP9r9_QHQXMx-ECu2OMX7hODsH10CEl-vLWuYBFJQC0L2919cYipPeS08poHqV2pf5Tw_U_Ic5cLxHAdRA9ikAy361-tNLqM7_DvhhpefL3urv0i8be_8HDx6oDg9a3DgIhf0W85eRT4Myjp-Q_-dlX18mlB6ocvgw1i84CKWknp_EKDX6hdHxYPSIcgqO_MIapQ8D2jCPZRvX_uUkrfPxzh2NbTY2WSMibtMqKbO6asomWlqiRqRjMTVlU3EhqiKfyrruOedxSvuyimRLCeVJShUlWUNNTEXCaZ82VIt0bLIM8oRvQqpYqV-32Ng5ks6t3FZNldSREj0rt10BIs0P3IphxMU5sm3AHPp1dpAnSjrvPli89IrbwdzuUrE9WA_UKdkDdc9jCdS9aOftPjqp5xB8PEB2LOsEsmMF2RHZWmPD5spuv2yKxZ_RalW7eH93kB2BOqBuln5Z-3gwt6Cjfr3_He7W7Geh26w7oG5r7a8AAAD__4PFKTk">