summaryrefslogtreecommitdiff
path: root/src/wpad.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-17 15:52:23 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-21 00:20:58 +0200
commit24e107fb47d9ec8b89323ef48d59d0948206339f (patch)
treefdf92c9ebfc63376cb7d8673bf2987c62c2487d2 /src/wpad.c
parentd61fd8af9cf7d2810718880d8313c3ab07baad7a (diff)
downloadconnman-24e107fb47d9ec8b89323ef48d59d0948206339f.tar.gz
connman-24e107fb47d9ec8b89323ef48d59d0948206339f.tar.bz2
connman-24e107fb47d9ec8b89323ef48d59d0948206339f.zip
wpad: Reference count service properly
Diffstat (limited to 'src/wpad.c')
-rw-r--r--src/wpad.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wpad.c b/src/wpad.c
index 931423c1..dd25c7c6 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)