summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-08-30 16:34:42 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-08-30 16:34:42 +0400
commit7a410baed07759ee3cef8c73b3d23f292355b005 (patch)
treee5421e6c44991f2e8f6e718afa41ee2c1c83e681 /accel-pppd/radius
parentc82ae5ec90ea56af314671ce09ca0f68694b745e (diff)
downloadaccel-ppp-7a410baed07759ee3cef8c73b3d23f292355b005.tar.gz
accel-ppp-7a410baed07759ee3cef8c73b3d23f292355b005.zip
radius: fix incorrect 'out of memory' message
Diffstat (limited to 'accel-pppd/radius')
-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 dcf2efe1..e3baee58 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 3c4a38b2..387cdd14 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;
}