summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/acct.c
diff options
context:
space:
mode:
authorAleksey Zhukov <drdaeman@drdaeman.pp.ru>2012-12-26 01:35:35 +0400
committerKozlov Dmitry <xeb@mail.ru>2013-01-25 00:12:40 +0400
commit5cb4eede1814cacbbb50c330e938866ba777f49b (patch)
treed8a78b980638ecb1e014718f1749b568047415c8 /accel-pppd/radius/acct.c
parente7d09a09b377e0b778958d156a3047337aefc6f8 (diff)
downloadaccel-ppp-5cb4eede1814cacbbb50c330e938866ba777f49b.tar.gz
accel-ppp-5cb4eede1814cacbbb50c330e938866ba777f49b.zip
Do not segfault on RADIUS failures during interim
Diffstat (limited to 'accel-pppd/radius/acct.c')
-rw-r--r--accel-pppd/radius/acct.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index 81145cd..d6a84de 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -209,6 +209,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);