s3:load_interfaces(): use function gfree_interfaces() that we have.
authorMichael Adam <obnox@samba.org>
Wed, 18 Nov 2009 14:19:09 +0000 (15:19 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 18 Nov 2009 21:19:18 +0000 (22:19 +0100)
To reduce code duplication.

Michael

source3/lib/interface.c

index 4a8a154edbc956f6f784ed9e6e60f6cd65210997..79c62a7ae71b738d4afceafaa395942df804988a 100644 (file)
@@ -496,15 +496,7 @@ void load_interfaces(void)
        const char **ptr = lp_interfaces();
        int i;
 
-       SAFE_FREE(probed_ifaces);
-
-       /* dump the current interfaces if any */
-       while (local_interfaces) {
-               struct interface *iface = local_interfaces;
-               DLIST_REMOVE(local_interfaces, local_interfaces);
-               SAFE_FREE(iface->name);
-               SAFE_FREE(iface);
-       }
+       gfree_interfaces();
 
        /* Probe the kernel for interfaces */
        total_probed = get_interfaces(talloc_tos(), &ifaces);