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