Commit 49c904c9 authored by Timo Teräs's avatar Timo Teräs

io: fix mmap bstream fd leak

We need to close the fd on destruction. This is what the corresponding
istream variant does too.
parent 36463504
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi> * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published * under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation. See http://www.gnu.org/ for details. * by the Free Software Foundation. See http://www.gnu.org/ for details.
*/ */
...@@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size) ...@@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size)
*size = mbs->size; *size = mbs->size;
munmap(mbs->ptr, mbs->size); munmap(mbs->ptr, mbs->size);
close(mbs->fd);
free(mbs); free(mbs);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment