Skip to content

Commit

Permalink
Check for failure opening /dev/null
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Apr 6, 2020
1 parent cd0965a commit ce611d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions auth.c
Expand Up @@ -1185,8 +1185,10 @@ static int run_csd_script(struct openconnect_info *vpninfo, char *buf, int bufle
*/
if (ferror(stderr)) {
int nulfd = open("/dev/null", O_WRONLY);
dup2(nulfd, 2);
close(nulfd);
if (nulfd >= 0) {
dup2(nulfd, 2);
close(nulfd);
}
}
dup2(2, 1);
if (vpninfo->csd_wrapper)
Expand Down

0 comments on commit ce611d8

Please sign in to comment.