summaryrefslogtreecommitdiff
path: root/src/dhcpv6.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-05-04 13:32:07 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-04 16:15:41 +0300
commit89537a7c5fac80a99ca516af3b4cb410ea1d546b (patch)
treee6c262f31ebcb662a83b2005cb9037c66ac56ea9 /src/dhcpv6.c
parent651b5920aceb10a5c53424a9723d9365ba612316 (diff)
downloadconnman-89537a7c5fac80a99ca516af3b4cb410ea1d546b.tar.gz
connman-89537a7c5fac80a99ca516af3b4cb410ea1d546b.tar.bz2
connman-89537a7c5fac80a99ca516af3b4cb410ea1d546b.zip
dhcpv6: Possible memory leak
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r--src/dhcpv6.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 9b15e6ab..1d1feb29 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -342,12 +342,16 @@ static int dhcpv6_info_request(struct connman_dhcpv6 *dhcp)
g_dhcp_client_set_debug(dhcp_client, dhcpv6_debug, "DHCPv6");
service = __connman_service_lookup_from_network(dhcp->network);
- if (service == NULL)
+ if (service == NULL) {
+ g_dhcp_client_unref(dhcp_client);
return -EINVAL;
+ }
ret = set_duid(service, dhcp->network, dhcp_client, index);
- if (ret < 0)
+ if (ret < 0) {
+ g_dhcp_client_unref(dhcp_client);
return ret;
+ }
g_dhcp_client_set_request(dhcp_client, G_DHCPV6_CLIENTID);
g_dhcp_client_set_request(dhcp_client, G_DHCPV6_DNS_SERVERS);
@@ -1102,12 +1106,16 @@ static int dhcpv6_solicitation(struct connman_dhcpv6 *dhcp)
g_dhcp_client_set_debug(dhcp_client, dhcpv6_debug, "DHCPv6");
service = __connman_service_lookup_from_network(dhcp->network);
- if (service == NULL)
+ if (service == NULL) {
+ g_dhcp_client_unref(dhcp_client);
return -EINVAL;
+ }
ret = set_duid(service, dhcp->network, dhcp_client, index);
- if (ret < 0)
+ if (ret < 0) {
+ g_dhcp_client_unref(dhcp_client);
return ret;
+ }
g_dhcp_client_set_request(dhcp_client, G_DHCPV6_CLIENTID);
g_dhcp_client_set_request(dhcp_client, G_DHCPV6_RAPID_COMMIT);