summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-03-24 12:58:12 +0000
committerRoy Marples <roy@marples.name>2012-03-24 12:58:12 +0000
commitbb02dff14da7b4a77ed25567574088bcd0b4f81d (patch)
treed261a3e91ada436bd62fc95c997a2431d65e3051
parentb5de3cec6a33b96d2e96741ce2c195b74a84aee1 (diff)
downloaddhcpcd-bb02dff14da7b4a77ed25567574088bcd0b4f81d.tar.xz
Fix a double free, #243.
Stop leaking memory on interface restart with prior RA.
-rw-r--r--ipv6rs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index 8ebdbd89..df969340 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -533,7 +533,8 @@ ipv6rs_handledata(_unused void *arg)
rap->options = rao;
rao->type = ndo->nd_opt_type;
rao->option = opt;
- }
+ } else
+ free(opt);
if (lifetime == ~0U)
timerclear(&rao->expire);
else {
@@ -751,7 +752,6 @@ ipv6rs_start(struct interface *ifp)
/* Always make a new probe as the underlying hardware
* address could have changed. */
- free(ifp->rs);
ipv6rs_makeprobe(ifp);
if (ifp->rs == NULL)
return -1;