fish: Don't leak stdout_saved_fd on error path (found by Coverity).

This commit is contained in:
Richard W.M. Jones
2012-12-08 15:32:14 +00:00
parent 855f023d2e
commit 6d94de3f20

View File

@@ -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)) {