Skip to content

Commit a5b54e4

Browse files
Update src/vma/util/utils.cpp
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 2582fae commit a5b54e4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/vma/util/utils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,11 @@ int read_file_to_int(const char *path, int default_value)
425425
c[sz] = '\0';
426426
int n = sscanf(reinterpret_cast<const char *>(&c), "%d", &value);
427427
if (n == 1) {
428+
close(fd);
428429
return value;
429430
}
430431
}
432+
close(fd);
431433
}
432434

433435
__log_warn("ERROR while getting int from from file %s, we'll use default %d", path, default_value);

0 commit comments

Comments
 (0)