diff options
Diffstat (limited to 'core/apk-tools/fd-leak2.patch')
-rw-r--r-- | core/apk-tools/fd-leak2.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/apk-tools/fd-leak2.patch b/core/apk-tools/fd-leak2.patch new file mode 100644 index 0000000000..033bc0dc19 --- /dev/null +++ b/core/apk-tools/fd-leak2.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | commit 49c904c993d39cfac7d3373c66f5b910e755f203 | ||
2 | Author: Timo Teras <timo.teras@iki.fi> | ||
3 | Date: Thu Jun 11 13:03:10 2009 +0300 | ||
4 | |||
5 | io: fix mmap bstream fd leak | ||
6 | |||
7 | We need to close the fd on destruction. This is what the corresponding | ||
8 | istream variant does too. | ||
9 | |||
10 | diff --git a/src/io.c b/src/io.c | ||
11 | index e0a9c9b..defbe46 100644 | ||
12 | --- a/src/io.c | ||
13 | +++ b/src/io.c | ||
14 | @@ -4,7 +4,7 @@ | ||
15 | * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi> | ||
16 | * All rights reserved. | ||
17 | * | ||
18 | - * This program is free software; you can redistribute it and/or modify it | ||
19 | + * This program is free software; you can redistribute it and/or modify it | ||
20 | * under the terms of the GNU General Public License version 2 as published | ||
21 | * by the Free Software Foundation. See http://www.gnu.org/ for details. | ||
22 | */ | ||
23 | @@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size) | ||
24 | *size = mbs->size; | ||
25 | |||
26 | munmap(mbs->ptr, mbs->size); | ||
27 | + close(mbs->fd); | ||
28 | free(mbs); | ||
29 | } | ||
30 | |||