/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2014-06-14 02:52:31 UTC
  • mto: (237.7.272 trunk)
  • mto: This revision was merged to the branch mainline in revision 317.
  • Revision ID: teddy@recompile.se-20140614025231-xpairrn1olkfgsek
plugin-runner: Do not leak file descriptors on certain errors.

* plugin-runner.c (main): If set_cloexec_flag fails, close pipe FD's.

Show diffs side-by-side

added added

removed removed

Lines of Context:
985
985
    ret = set_cloexec_flag(pipefd[0]);
986
986
    if(ret < 0){
987
987
      error(0, errno, "set_cloexec_flag");
 
988
      TEMP_FAILURE_RETRY(close(pipefd[0]));
 
989
      TEMP_FAILURE_RETRY(close(pipefd[1]));
988
990
      exitstatus = EX_OSERR;
989
991
      goto fallback;
990
992
    }
991
993
    ret = set_cloexec_flag(pipefd[1]);
992
994
    if(ret < 0){
993
995
      error(0, errno, "set_cloexec_flag");
 
996
      TEMP_FAILURE_RETRY(close(pipefd[0]));
 
997
      TEMP_FAILURE_RETRY(close(pipefd[1]));
994
998
      exitstatus = EX_OSERR;
995
999
      goto fallback;
996
1000
    }