summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLubos Kardos <lkardos@redhat.com>2015-02-16 14:45:39 +0100
committerLubos Kardos <lkardos@redhat.com>2015-02-16 15:16:11 +0100
commit67afe190ec6a2222d1c10647558026c564a523ee (patch)
tree6c322a44a2c4f11e26ddb4e819bf46bb75ab5a67 /lib
parentfbdf2995c5fb9a826e9280e6014bc25586b811e3 (diff)
downloadrpm-67afe190ec6a2222d1c10647558026c564a523ee.tar.gz
Fix leaking of file descriptors.
This was caused by commit 278c55266682f61a23433224e0197997c572706a.
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmscript.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rpmscript.c b/lib/rpmscript.c
index fd507d886..fa24fe1fc 100644
--- a/lib/rpmscript.c
+++ b/lib/rpmscript.c
@@ -327,6 +327,8 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
_exit(126); /* exit 126 for compatibility with bash(1) */
}
}
+ close(inpipe[0]);
+ inpipe[0] = 0;
if (nextFileFunc->func) {
while ((line = nextFileFunc->func(nextFileFunc->param)) != NULL) {
@@ -374,6 +376,9 @@ exit:
if (in)
fclose(in);
+ if (inpipe[0])
+ close(inpipe[0]);
+
if (out)
Fclose(out); /* XXX dup'd STDOUT_FILENO */