From 3ea861415d2083f131a5bcb5dcb9716a416e05ad Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Thu, 26 Sep 2024 09:24:44 +0200 Subject: [PATCH] Close file descriptor in is_mapped_with_MAP_SYNC() Signed-off-by: Lukasz Dorau --- test/common/test_helpers_linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/common/test_helpers_linux.c b/test/common/test_helpers_linux.c index 9f7606b09..431880bf7 100644 --- a/test/common/test_helpers_linux.c +++ b/test/common/test_helpers_linux.c @@ -40,6 +40,8 @@ bool is_mapped_with_MAP_SYNC(char *path, char *buf, size_t size_buf) { smaps = strstr(buf, path); } + (void)close(fd); + // String starting from the "sf" flag // marking that memory was mapped with the MAP_SYNC flag. char *sf_flag = NULL;