From: Roy Marples Date: Sat, 24 Mar 2012 12:58:12 +0000 (+0000) Subject: Fix a double free, #243. X-Git-Tag: v5.5.6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb02dff14da7b4a77ed25567574088bcd0b4f81d;p=thirdparty%2Fdhcpcd.git Fix a double free, #243. Stop leaking memory on interface restart with prior RA. --- 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;