From 09b155588131d8ed6f380aec467d0fa7749933b8 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Thu, 19 Jul 2012 19:07:42 +0400 Subject: radius: multiple disctionary options support --- accel-pppd/radius/dict.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'accel-pppd/radius/dict.c') 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) { -- cgit v1.2.3