summaryrefslogtreecommitdiff
path: root/src/common/compat.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-05 17:53:32 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-05 17:53:32 +0000
commit1b7ad5aed3063b0f2fb66b6a6f50dadf5c76d15f (patch)
tree690ac2acfe2baace25f249d12736c95097387680 /src/common/compat.c
parent7c596c166b27e44aceb2906f343cd8b261824fda (diff)
downloadtor-1b7ad5aed3063b0f2fb66b6a6f50dadf5c76d15f.tar.gz
tor-1b7ad5aed3063b0f2fb66b6a6f50dadf5c76d15f.zip
r7030@Kushana: nickm | 2006-08-04 14:46:52 -0700
Close an fd leak on failed mmap() svn:r6988
Diffstat (limited to 'src/common/compat.c')
-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;