diff options
author | Aleksey Zhukov <drdaeman@drdaeman.pp.ru> | 2012-12-26 01:35:35 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-12-26 01:35:35 +0400 |
commit | 812813bf523901dd091bb071f22986e71cdcea6a (patch) | |
tree | 3dd3dcd365cecd44776e29127d63124314c72b83 | |
parent | d16b78813da8b69aafd13ca5086850a5d27a871e (diff) | |
download | accel-ppp-812813bf523901dd091bb071f22986e71cdcea6a.tar.gz accel-ppp-812813bf523901dd091bb071f22986e71cdcea6a.zip |
Do not segfault on RADIUS failures during interim
-rw-r--r-- | accel-pppd/radius/acct.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index 9a832a9c..43e5549a 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -202,6 +202,12 @@ static void rad_acct_interim_update(struct triton_timer_t *t) req_set_RA(rpd->acct_req, rpd->acct_req->serv->secret); __rad_req_send(rpd->acct_req); + /* The above call may set rpd->acct_req to NULL in the following chain of events: + 1. __rad_req_send fails (on rad_server_realloc) and calls ppp_terminate; + 2. As a result, an EV_PPP_FINISHING event is fired; + 3. ppp_finishing calls rad_acct_stop that cleans up the request. */ + if (!rpd->acct_req) + return; __sync_add_and_fetch(&rpd->acct_req->serv->stat_interim_sent, 1); |