diff options
author | venaas <venaas> | 2008-10-13 14:28:11 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-10-13 14:28:11 +0000 |
commit | f07282621239425826542fdcc0668398ffd7482f (patch) | |
tree | d6461356e92abd5e9fde5b66bc6f3acfda5ff2f1 /radsecproxy.c | |
parent | 8bad57de823fc72394145f4a29678b4b72b8ed7a (diff) |
using freegconfmstr
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@427 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index a682ead..18e5942 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2697,17 +2697,13 @@ struct realm *addrealm(struct list *realmlist, char *value, char **servers, char if (realm) for (n = 0; servers[n]; n++) newrealmref(realm); - for (n = 0; servers[n]; n++) - free(servers[n]); - free(servers); + freegconfmstr(servers); } if (accservers) { if (realm) for (n = 0; accservers[n]; n++) newrealmref(realm); - for (n = 0; accservers[n]; n++) - free(accservers[n]); - free(accservers); + freegconfmstr(accservers); } return newrealmref(realm); } @@ -3016,12 +3012,10 @@ void addrewrite(char *value, char **rmattrs, char **rmvattrs, char **addattrs, c if (!rma) debugx(1, DBG_ERR, "malloc failed"); - for (i = 0; i < n; i++) { + for (i = 0; i < n; i++) if (!(rma[i] = attrname2val(rmattrs[i]))) debugx(1, DBG_ERR, "addrewrite: invalid attribute %s", rmattrs[i]); - free(rmattrs[i]); - } - free(rmattrs); + freegconfmstr(rmattrs); rma[i] = 0; } @@ -3031,12 +3025,10 @@ void addrewrite(char *value, char **rmattrs, char **rmvattrs, char **addattrs, c if (!rmva) debugx(1, DBG_ERR, "malloc failed"); - for (p = rmva, i = 0; i < n; i++, p += 2) { + for (p = rmva, i = 0; i < n; i++, p += 2) if (!vattrname2val(rmvattrs[i], p, p + 1)) debugx(1, DBG_ERR, "addrewrite: invalid vendor attribute %s", rmvattrs[i]); - free(rmvattrs[i]); - } - free(rmvattrs); + freegconfmstr(rmvattrs); *p = 0; } @@ -3048,11 +3040,10 @@ void addrewrite(char *value, char **rmattrs, char **rmvattrs, char **addattrs, c a = extractattr(addattrs[i]); if (!a) debugx(1, DBG_ERR, "addrewrite: invalid attribute %s", addattrs[i]); - free(addattrs[i]); if (!list_push(adda, a)) debugx(1, DBG_ERR, "malloc failed"); } - free(addattrs); + freegconfmstr(addattrs); } if (modattrs) { @@ -3063,11 +3054,10 @@ void addrewrite(char *value, char **rmattrs, char **rmvattrs, char **addattrs, c m = extractmodattr(modattrs[i]); if (!m) debugx(1, DBG_ERR, "addrewrite: invalid attribute %s", modattrs[i]); - free(modattrs[i]); if (!list_push(moda, m)) debugx(1, DBG_ERR, "malloc failed"); } - free(modattrs); + freegconfmstr(modattrs); } if (rma || rmva || adda || moda) { |