summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/compat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index f55baf9041..1d71d5be1d 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -134,6 +134,7 @@ tor_mmap_file(const char *filename)
string = mmap(0, size, PROT_READ, MAP_PRIVATE, fd, 0);
if (string == MAP_FAILED) {
+ close(fd);
log_warn(LD_FS,"Could not mmap file \"%s\": %s", filename,
strerror(errno));
return NULL;