]> git.ozlabs.org Git - ppp.git/commitdiff
fix buglets
authorPaul Mackerras <paulus@samba.org>
Wed, 28 Apr 1999 02:45:44 +0000 (02:45 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 28 Apr 1999 02:45:44 +0000 (02:45 +0000)
pppd/main.c
pppd/upap.c

index 5de88e4482e8e2aec3ddd3861275fbca6440d269..e67e18c9b5abf6bfcb85fa17039a4a264ecdd7c4 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.76 1999/04/16 11:35:06 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.77 1999/04/28 02:45:44 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -1557,9 +1557,12 @@ reap_kids(waitfor)
     while ((pid = waitpid(-1, &status, (waitfor? 0: WNOHANG))) != -1
           && pid != 0) {
        --n_children;
-       for (prevp = &children; (chp = *prevp) != NULL; prevp = &chp->next)
-           if (chp->pid == pid)
+       for (prevp = &children; (chp = *prevp) != NULL; prevp = &chp->next) {
+           if (chp->pid == pid) {
+               *prevp = chp->next;
                break;
+           }
+       }
        if (WIFSIGNALED(status)) {
            warn("Child process %s (pid %d) terminated with signal %d",
                 (chp? chp->prog: "??"), pid, WTERMSIG(status));
@@ -1568,6 +1571,8 @@ reap_kids(waitfor)
                   (chp? chp->prog: "??"), pid, status);
        if (chp && chp->done)
            (*chp->done)(chp->arg);
+       if (chp)
+           free(chp);
     }
     if (pid == -1 && errno != ECHILD && errno != EINTR)
        error("Error waiting for child process: %m");
index 0078adfeec17d981f51a16bb3f5cdfada9e292da..c59f0ba1fac30753d9475dd8bc8ba81685f4b261 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: upap.c,v 1.15 1999/03/16 22:54:43 paulus Exp $";
+static char rcsid[] = "$Id: upap.c,v 1.16 1999/04/28 02:45:44 paulus Exp $";
 #endif
 
 /*
@@ -38,7 +38,7 @@ static bool hide_password;
  */
 static option_t pap_option_list[] = {
     { "hide-password", o_bool, &hide_password,
-      "Don't output passwords to log" },
+      "Don't output passwords to log", 1 },
     { "pap-restart", o_int, &upap[0].us_timeouttime,
       "Set retransmit timeout for PAP" },
     { "pap-max-authreq", o_int, &upap[0].us_maxtransmits,