diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-07-19 19:07:42 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-07-19 19:07:42 +0400 |
commit | 09b155588131d8ed6f380aec467d0fa7749933b8 (patch) | |
tree | aa31d14ac81cc6b653daa7fdfac296bfa5a9f69e /accel-pppd/radius/dict.c | |
parent | ca1779b61f9a1f8390d964bf9d76c0f12caa25ed (diff) | |
download | accel-ppp-xebd-09b155588131d8ed6f380aec467d0fa7749933b8.tar.gz accel-ppp-xebd-09b155588131d8ed6f380aec467d0fa7749933b8.zip |
radius: multiple disctionary options support
Diffstat (limited to 'accel-pppd/radius/dict.c')
-rw-r--r-- | accel-pppd/radius/dict.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/accel-pppd/radius/dict.c b/accel-pppd/radius/dict.c index 146d1c1..32af344 100644 --- a/accel-pppd/radius/dict.c +++ b/accel-pppd/radius/dict.c @@ -206,7 +206,7 @@ static int dict_load(const char *fname) return 0; out_err_syntax: - log_emerg("radius:%s:%i: syntaxis error\n", fname, n); + log_emerg("radius:%s:%i: syntax error\n", fname, n); out_err: fclose(f); return -1; @@ -216,13 +216,16 @@ int rad_dict_load(const char *fname) { int r = -1; - dict = malloc(sizeof(*dict)); if (!dict) { - log_emerg("radius: out of memory\n"); - return -1; + dict = malloc(sizeof(*dict)); + + if (!dict) { + log_emerg("radius: out of memory\n"); + return -1; + } + INIT_LIST_HEAD(&dict->items); + INIT_LIST_HEAD(&dict->vendors); } - INIT_LIST_HEAD(&dict->items); - INIT_LIST_HEAD(&dict->vendors); path = _malloc(PATH_MAX); if (!path) { |