From 812813bf523901dd091bb071f22986e71cdcea6a Mon Sep 17 00:00:00 2001 From: Aleksey Zhukov Date: Wed, 26 Dec 2012 01:35:35 +0400 Subject: Do not segfault on RADIUS failures during interim --- accel-pppd/radius/acct.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3