summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/extra/pppd_compat.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 85fc02e8..7bdf5974 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -140,25 +140,24 @@ static void ev_ses_pre_up(struct ap_session *ses)
if (!pd)
return;
-
+
#ifdef RADIUS
- {
- char *fname = _malloc(PATH_MAX);
- if (!fname) {
- log_emerg("pppd_compat: out of memory\n");
- return;
- }
-
- sprintf(fname, "%s.%s", conf_radattr_prefix, ses->ifname);
+ if (pd->tmp_fname) {
+ char *fname = _malloc(PATH_MAX);
- rename(pd->tmp_fname, fname);
-
- _free(fname);
- _free(pd->tmp_fname);
- pd->tmp_fname = NULL;
+ if (!fname) {
+ log_emerg("pppd_compat: out of memory\n");
+ return;
+ }
+
+ sprintf(fname, "%s.%s", conf_radattr_prefix, ses->ifname);
+ rename(pd->tmp_fname, fname);
+
+ _free(fname);
+ _free(pd->tmp_fname);
+ pd->tmp_fname = NULL;
}
#endif
-
if (ses->ipv4) {
pd->ipv4_addr = ses->ipv4->addr;