summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/radius/acct.c4
-rw-r--r--accel-pppd/radius/req.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index dcf2efe..e3baee5 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -232,10 +232,8 @@ int rad_acct_start(struct radius_pd_t *rpd)
return 0;
rpd->acct_req = rad_req_alloc(rpd, CODE_ACCOUNTING_REQUEST, rpd->ppp->username);
- if (!rpd->acct_req) {
- log_emerg("radius: out of memory\n");
+ if (!rpd->acct_req)
return -1;
- }
if (rad_req_acct_fill(rpd->acct_req)) {
log_ppp_error("radius:acct: failed to fill accounting attributes\n");
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 3c4a38b..387cdd1 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -24,8 +24,10 @@ struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *u
struct rad_plugin_t *plugin;
struct rad_req_t *req = _malloc(sizeof(*req));
- if (!req)
+ if (!req) {
+ log_emerg("radius: out of memory\n");
return NULL;
+ }
memset(req, 0, sizeof(*req));
req->rpd = rpd;
@@ -97,6 +99,10 @@ struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *u
return req;
out_err:
+ if (!req->serv)
+ log_ppp_error("radius: no servers available\n");
+ else
+ log_emerg("radius: out of memory\n");
rad_req_free(req);
return NULL;
}