summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-06-11 13:03:10 +0300
committerTimo Teras <timo.teras@iki.fi>2009-06-11 13:03:10 +0300
commit49c904c993d39cfac7d3373c66f5b910e755f203 (patch)
tree3546ed6ffd50364b72aef0ee849a70bf3c95c38c /src/io.c
parent3646350479b960602c53ed45b21be771e7c3f43c (diff)
downloadapk-tools-49c904c993d39cfac7d3373c66f5b910e755f203.tar.gz
apk-tools-49c904c993d39cfac7d3373c66f5b910e755f203.tar.bz2
apk-tools-49c904c993d39cfac7d3373c66f5b910e755f203.tar.xz
apk-tools-49c904c993d39cfac7d3373c66f5b910e755f203.zip
io: fix mmap bstream fd leak
We need to close the fd on destruction. This is what the corresponding istream variant does too.
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index e0a9c9b..defbe46 100644
--- a/src/io.c
+++ b/src/io.c
@@ -4,7 +4,7 @@
* Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
* 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
* 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)
*size = mbs->size;
munmap(mbs->ptr, mbs->size);
+ close(mbs->fd);
free(mbs);
}