From 6d94de3f204bf01aa74cb06cfa796d54204dd08d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 8 Dec 2012 15:32:14 +0000 Subject: [PATCH] fish: Don't leak stdout_saved_fd on error path (found by Coverity). --- fish/fish.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fish/fish.c b/fish/fish.c index b24c49c7a..5892d7746 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1147,6 +1147,8 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd, */ if (fflush (stdout) == EOF) { perror ("failed to flush standard output"); + if (pipecmd) + close (stdout_saved_fd); return -1; } if (ferror (stdout)) {