diff options
author | taesubkim <taesub.kim@samsung.com> | 2016-04-26 15:47:01 +0900 |
---|---|---|
committer | taesubkim <taesub.kim@samsung.com> | 2016-04-26 16:14:46 +0900 |
commit | 22633ced6225d294ce8483efbf2b39ea0c0c1b65 (patch) | |
tree | 8c5f2312feec413068a18e57a80321b31b4f7b74 /src/connection.c | |
parent | bcae74da8fa2958b3fec9153fc33e41f0e0317bf (diff) | |
download | connman-22633ced6225d294ce8483efbf2b39ea0c0c1b65.tar.gz connman-22633ced6225d294ce8483efbf2b39ea0c0c1b65.tar.bz2 connman-22633ced6225d294ce8483efbf2b39ea0c0c1b65.zip |
Imported Upstream version 1.29upstream/1.29
Change-Id: I2958446c35966d9ed72df0120b80561be7d89f54
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/connection.c b/src/connection.c index 8fe97258..aa4e1c05 100644 --- a/src/connection.c +++ b/src/connection.c @@ -401,13 +401,9 @@ static struct gateway_data *add_gateway(struct connman_service *service, data->ipv4_gateway = old->ipv4_gateway; old->ipv4_gateway = NULL; } - } else { - /* - * Only take a ref if we are adding new stuff to hash. - */ - connman_service_ref(service); } + connman_service_ref(data->service); g_hash_table_replace(gateway_hash, service, data); return data; @@ -708,6 +704,8 @@ static void remove_gateway(gpointer user_data) g_free(data->ipv6_gateway); } + connman_service_unref(data->service); + g_free(data); } @@ -999,9 +997,7 @@ void __connman_connection_gateway_remove(struct connman_service *service, (data->ipv4_gateway && !data->ipv6_gateway && do_ipv4) || (data->ipv6_gateway && !data->ipv4_gateway - && do_ipv6) - ) { - connman_service_unref(service); + && do_ipv6)) { g_hash_table_remove(gateway_hash, service); } else DBG("Not yet removing gw ipv4 %p/%d ipv6 %p/%d", |