Service may be refcount two times when add_gateway for both ipv4 and
ipv6, we need to unref the service twice according when we have both
ipv6 and ipv4 gateway
---
 src/connection.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 54f2b74..58adfeb 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -713,6 +713,14 @@ void __connman_connection_gateway_remove(struct 
connman_service *service,
        err = disable_gateway(data, type);
 
        /*
+        * We may refcount service twice seperately for ipv4 and ipv6
+        * then we need to unref accordingly.
+        */
+       if (do_ipv4 == do_ipv6 && data->ipv4_gateway != NULL &&
+                                       data->ipv6_gateway != NULL)
+               connman_service_unref(service);
+
+       /*
         * We remove the service from the hash only if all the gateway
         * settings are to be removed.
         */
-- 
1.7.2.2

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to