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)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:41:00 +0000 (11:41 +0100)
To reduce code duplication.

Michael
(cherry picked from commit aea3a8f50131744f8393d0179cd04a1b97982028)
(cherry picked from commit 5caad323a212a3f046adb7e5a7d86edc819a2d3a)

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);