]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a double free, #243.
authorRoy Marples <roy@marples.name>
Sat, 24 Mar 2012 12:58:12 +0000 (12:58 +0000)
committerRoy Marples <roy@marples.name>
Sat, 24 Mar 2012 12:58:12 +0000 (12:58 +0000)
Stop leaking memory on interface restart with prior RA.

ipv6rs.c

index 8ebdbd89f257dee1f3a84583df898bfd88ca2e01..df969340626e2553d39f7072390a91ccb5386b54 100644 (file)
--- 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;