Close pipe FD's on failed fork
authorAlan T. DeKok <aland@freeradius.org>
Sat, 23 Aug 2008 19:42:08 +0000 (21:42 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 24 Aug 2008 06:50:21 +0000 (08:50 +0200)
src/main/exec.c

index f26f539..3460468 100644 (file)
@@ -350,6 +350,10 @@ int radius_exec_program(const char *cmd, REQUEST *request,
        if (pid < 0) {
                radlog(L_ERR|L_CONS, "Couldn't fork %s: %s",
                       argv[0], strerror(errno));
+               if (exec_wait) {
+                       close(pd[0]);
+                       close(pd[1]);
+               }
                return -1;
        }