summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-12-19 13:33:57 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-12-19 13:33:57 +0300
commit4d5401bff79a0d772bba8cc03be148af83c3de08 (patch)
tree2adbef575226c004f83e2bc7ec8cc72814590a0f /accel-pppd/ctrl
parent439d11a7424ee4b166d58754193185d4a778307d (diff)
downloadaccel-ppp-4d5401bff79a0d772bba8cc03be148af83c3de08.tar.gz
accel-ppp-4d5401bff79a0d772bba8cc03be148af83c3de08.zip
ipoe: fixed memory leak
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index ecf1b8a9..5db66577 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -2125,7 +2125,7 @@ static void ev_radius_access_accept(struct ev_radius_t *ev)
{
struct ipoe_session *ses = container_of(ev->ses, typeof(*ses), ses);
struct rad_attr_t *attr;
- int lease_time_set = 0, renew_time_set = 0;
+ int lease_time_set = 0, renew_time_set = 0, has_dhcp = 0;
if (ev->ses->ctrl->type != CTRL_TYPE_IPOE)
return;
@@ -2134,7 +2134,7 @@ static void ev_radius_access_accept(struct ev_radius_t *ev)
int vendor_id = attr->vendor ? attr->vendor->id : 0;
if (vendor_id == VENDOR_DHCP) {
- ses->dhcpv4_relay_reply = dhcpv4_clone_radius(ev->reply);
+ has_dhcp = 1;
switch (attr->attr->id) {
case DHCP_Your_IP_Address:
@@ -2201,6 +2201,9 @@ static void ev_radius_access_accept(struct ev_radius_t *ev)
log_ppp_warn("ipoe: overriding renew time\n");
ses->renew_time = ses->lease_time / 2;
}
+
+ if (has_dhcp)
+ ses->dhcpv4_relay_reply = dhcpv4_clone_radius(ev->reply);
}
static void ev_radius_coa(struct ev_radius_t *ev)