From: Alan T. DeKok Date: Tue, 15 Dec 2009 13:17:52 +0000 (+0100) Subject: Catch situations where COA may be NULL X-Git-Tag: release_2_1_8~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a60495f0046fc129609c324d534edbd5edb2ad2e;p=thirdparty%2Ffreeradius-server.git Catch situations where COA may be NULL --- diff --git a/src/main/event.c b/src/main/event.c index 56a9bc19701..6ec0308d568 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -1432,18 +1432,26 @@ static int originated_coa_request(REQUEST *request) rad_assert(!request->in_proxy_hash); rad_assert(request->proxy_reply == NULL); + /* + * Check whether we want to originate one, or cancel one. + */ vp = pairfind(request->config_items, PW_SEND_COA_REQUEST); - if (!vp && request->coa) vp = pairfind(request->coa->proxy->vps, PW_SEND_COA_REQUEST); + if (!vp && request->coa) { + vp = pairfind(request->coa->proxy->vps, PW_SEND_COA_REQUEST); + } + if (vp) { if (vp->vp_integer == 0) { ev_request_free(&request->coa); return 1; /* success */ } - if (!request->coa) request_alloc_coa(request); - if (!request->coa) return 0; + } + if (!request->coa) request_alloc_coa(request); + if (!request->coa) return 0; + coa = request->coa; /*