projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c18f64
)
Check for allocation failure
author
Alan T. DeKok
<aland@freeradius.org>
Thu, 4 Feb 2010 07:59:53 +0000
(08:59 +0100)
committer
Alan T. DeKok
<aland@freeradius.org>
Thu, 4 Feb 2010 08:02:55 +0000
(09:02 +0100)
src/main/util.c
patch
|
blob
|
history
diff --git
a/src/main/util.c
b/src/main/util.c
index
34d2094
..
6cd01b3
100644
(file)
--- 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;
}