summaryrefslogtreecommitdiff
path: root/src/dhcp.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-07-25 16:24:25 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-07-25 22:44:10 +0200
commitc8c7efd02661b17df0d4cf9388e34cf4491a3b09 (patch)
tree0579bfd9eb57d10c6bbe27e3a0c96a25d950a78b /src/dhcp.c
parent35689568e18459597cfefd5faebf3270be71b238 (diff)
downloadconnman-c8c7efd02661b17df0d4cf9388e34cf4491a3b09.tar.gz
connman-c8c7efd02661b17df0d4cf9388e34cf4491a3b09.tar.bz2
connman-c8c7efd02661b17df0d4cf9388e34cf4491a3b09.zip
dhcp: Fix memory leak
Reported by valgrind.
Diffstat (limited to 'src/dhcp.c')
-rw-r--r--src/dhcp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index 8092db15..39f4eeb5 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -84,11 +84,11 @@ static void dhcp_invalidate(struct connman_dhcp *dhcp, connman_bool_t callback)
service = __connman_service_lookup_from_network(dhcp->network);
if (service == NULL)
- return;
+ goto out;
ipconfig = __connman_service_get_ip4config(service);
if (ipconfig == NULL)
- return;
+ goto out;
__connman_6to4_remove(ipconfig);
@@ -113,6 +113,7 @@ static void dhcp_invalidate(struct connman_dhcp *dhcp, connman_bool_t callback)
if (dhcp->callback != NULL && callback)
dhcp->callback(dhcp->network, FALSE);
+out:
dhcp_free(dhcp);
}
@@ -278,6 +279,8 @@ static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data)
__connman_service_nameserver_append(service,
dhcp->nameservers[i]);
}
+ } else {
+ g_strfreev(nameservers);
}
if (g_strcmp0(timeserver, dhcp->timeserver) != 0) {