summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-09-25 21:03:39 -0700
committerTim King <taking@google.com>2016-09-25 21:03:39 -0700
commit30d6822d4df5cc91b1134b2da9e18d66b4ba7607 (patch)
treefeb4fdb0e8817ddbb7f7b00dea30a491991d2bfd
parente313adf1e1d0eda70d592c771690cde496c73def (diff)
Closing an open file descriptor in MemoryMapFile.
-rw-r--r--src/parser/memory_mapped_input_buffer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parser/memory_mapped_input_buffer.cpp b/src/parser/memory_mapped_input_buffer.cpp
index c9515aa92..1554428f7 100644
--- a/src/parser/memory_mapped_input_buffer.cpp
+++ b/src/parser/memory_mapped_input_buffer.cpp
@@ -110,6 +110,7 @@ static ANTLR3_UINT32 MemoryMapFile(pANTLR3_INPUT_STREAM input,
input->data = mmap(0, input->sizeBuf, PROT_READ, MAP_PRIVATE, fd, 0);
errno = 0;
+ close(fd);
if(intptr_t(input->data) == -1) {
return ANTLR3_ERR_NOMEM;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback