From 174f0f675c30b9e50831f8e86029307b0625e621 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 4 Feb 2010 08:59:53 +0100 Subject: [PATCH] Check for allocation failure --- src/main/util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/util.c b/src/main/util.c index 34d2094..6cd01b3 100644 --- a/src/main/util.c +++ b/src/main/util.c @@ -497,9 +497,15 @@ REQUEST *request_alloc_coa(REQUEST *request) (request->packet->code != PW_ACCOUNTING_REQUEST)) return NULL; request->coa = request_alloc_fake(request); + if (!request->coa) return NULL; + request->coa->packet->code = 0; /* unknown, as of yet */ request->coa->child_state = REQUEST_RUNNING; request->coa->proxy = rad_alloc(0); + if (!request->coa->proxy) { + request_free(&request->coa); + return NULL; + } return request->coa; } -- 2.1.4