From: Paul Mackerras Date: Wed, 28 Apr 1999 02:45:44 +0000 (+0000) Subject: fix buglets X-Git-Tag: ppp-2.4.7~723 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=0c7a998d2528a7f39af06e5c1eaaaad8ba24dc4b fix buglets --- diff --git a/pppd/main.c b/pppd/main.c index 5de88e4..e67e18c 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -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 @@ -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"); diff --git a/pppd/upap.c b/pppd/upap.c index 0078adf..c59f0ba 100644 --- a/pppd/upap.c +++ b/pppd/upap.c @@ -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,