aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/compiler-rt/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2024-02-21 10:24:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:14:19 +0000
commit56727255ad47072ec2cc81b4ae728a099697b0e4 (patch)
tree2c4b0de3a06821142fe17fd0766c4e800dd18369 /contrib/llvm-project/compiler-rt/lib
parent74626c16ff489c0d64cf2843dfd522e7c544f3ce (diff)
parentb3ca86c61e0626b777466609594a8da23ef637e8 (diff)
Diffstat (limited to 'contrib/llvm-project/compiler-rt/lib')
-rw-r--r--contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c b/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c
index 867ae73f0d3b..f3b457d786e6 100644
--- a/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -677,6 +677,7 @@ static void initializeProfileForContinuousMode(void) {
PROF_ERR("Continuous counter sync mode is enabled, but raw profile is not"
"page-aligned. CurrentFileOffset = %" PRIu64 ", pagesz = %u.\n",
(uint64_t)CurrentFileOffset, PageSize);
+ fclose(File);
return;
}
if (writeProfileWithFileObject(Filename, File) != 0) {
@@ -692,6 +693,8 @@ static void initializeProfileForContinuousMode(void) {
if (doMerging()) {
lprofUnlockFileHandle(File);
+ }
+ if (File != NULL) {
fclose(File);
}
}