]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Plug a leak.
authorRoy Marples <roy@marples.name>
Tue, 16 Dec 2008 13:35:05 +0000 (13:35 +0000)
committerRoy Marples <roy@marples.name>
Tue, 16 Dec 2008 13:35:05 +0000 (13:35 +0000)
configure.c

index 7ab10fcb69367b0cb5126715078950e86fdfdbc6..769b411a6b14d44f9b91196c295bf565137af0fe 100644 (file)
@@ -448,11 +448,12 @@ configure(struct interface *iface, const char *reason)
 
        /* We need to delete the subnet route to have our metric or
         * prefer the interface. */
-       if (iface->net.s_addr != INADDR_BROADCAST) {
-               rt = get_subnet_route(dhcp);
+       rt = get_subnet_route(dhcp);
+       if (rt != NULL) {
                rt->iface = iface;
                if (!find_route(routes, rt, NULL, NULL))
                        del_route(iface, &rt->dest, &rt->net, &rt->gate, 0);
+               free(rt);
        }
 
        build_routes();