dhcpv6-ia: use free_dhcpv6_assignment where needed
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 28 Dec 2016 22:23:55 +0000 (23:23 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 28 Dec 2016 22:54:08 +0000 (23:54 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/dhcpv6-ia.c

index 35c6ae33076e69ddfce1475ed0b21649d93cebbc..98fb460454c3b5eb301928e03e89640e6271e12f 100644 (file)
@@ -119,10 +119,8 @@ int setup_dhcpv6_ia_interface(struct interface *iface, bool enable)
                                        free(a->hostname);
                                        a->hostname = strdup(lease->hostname);
                                }
-                       } else {
-                               free(a->hostname);
-                               free(a);
-                       }
+                       } else
+                               free_dhcpv6_assignment(a);
                }
        }
        return 0;