summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 09adf63..cacf9d6 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1094,18 +1094,16 @@ int dorewritemod(struct radmsg *msg, struct list *modattrs) {
int dorewrite(struct radmsg *msg, struct rewrite *rewrite) {
int rv = 1; /* Success. */
- if (rewrite)
- return 1;
-
- if (rewrite->removeattrs || rewrite->removevendorattrs)
- dorewriterm(msg, rewrite->removeattrs, rewrite->removevendorattrs);
- if (rewrite->modattrs)
- if (!dorewritemod(msg, rewrite->modattrs))
- rv = 0;
- if (rewrite->addattrs)
- if (!dorewriteadd(msg, rewrite->addattrs))
- rv = 0;
-
+ if (rewrite) {
+ if (rewrite->removeattrs || rewrite->removevendorattrs)
+ dorewriterm(msg, rewrite->removeattrs, rewrite->removevendorattrs);
+ if (rewrite->modattrs)
+ if (!dorewritemod(msg, rewrite->modattrs))
+ rv = 0;
+ if (rewrite->addattrs)
+ if (!dorewriteadd(msg, rewrite->addattrs))
+ rv = 0;
+ }
return rv;
}