From 24e107fb47d9ec8b89323ef48d59d0948206339f Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Mon, 17 Oct 2011 15:52:23 +0300 Subject: [PATCH] wpad: Reference count service properly --- src/wpad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wpad.c b/src/wpad.c index 931423c..dd25c7c 100644 --- a/src/wpad.c +++ b/src/wpad.c @@ -170,6 +170,7 @@ int __connman_wpad_start(struct connman_service *service) g_resolv_lookup_hostname(wpad->resolv, wpad->hostname, wpad_result, wpad); + connman_service_ref(service); g_hash_table_replace(wpad_list, GINT_TO_POINTER(index), wpad); return 0; @@ -188,7 +189,8 @@ void __connman_wpad_stop(struct connman_service *service) if (index < 0) return; - g_hash_table_remove(wpad_list, GINT_TO_POINTER(index)); + if (g_hash_table_remove(wpad_list, GINT_TO_POINTER(index)) == TRUE) + connman_service_unref(service); } int __connman_wpad_init(void) -- 2.7.4