1 |
commit: 36a4fa02b2315b117b320139e8cac25f31930219 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 19 19:34:39 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 19 19:34:39 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=36a4fa02 |
7 |
|
8 |
qmerge: fix Coverity 206531 Double close |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
qmerge.c | 3 ++- |
13 |
1 file changed, 2 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/qmerge.c b/qmerge.c |
16 |
index e22f22f..6988285 100644 |
17 |
--- a/qmerge.c |
18 |
+++ b/qmerge.c |
19 |
@@ -767,7 +767,8 @@ merge_tree_at(int fd_src, const char *src, int fd_dst, const char *dst, |
20 |
return ret; |
21 |
} |
22 |
|
23 |
- dir = fdopendir(subfd_src); |
24 |
+ i = dup(subfd_src); /* fdopendir closes its argument */ |
25 |
+ dir = fdopendir(i); |
26 |
if (!dir) |
27 |
goto done; |