dnsproxy: Fix invalid hash table cleanup
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Mon, 16 Jan 2012 08:18:12 +0000 (09:18 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 16 Jan 2012 10:52:58 +0000 (11:52 +0100)
The remove_listener() should not call __connman_dnsproxy_remove_listener
because that function will modify the hash table.

src/dnsproxy.c

index adf7535..6f8d39a 100644 (file)
@@ -2734,7 +2734,12 @@ void __connman_dnsproxy_remove_listener(const char *interface)
 
 static void remove_listener(gpointer key, gpointer value, gpointer user_data)
 {
-       __connman_dnsproxy_remove_listener(key);
+       const char *interface = key;
+       struct listener_data *ifdata = value;
+
+       DBG("interface %s", interface);
+
+       destroy_listener(ifdata);
 }
 
 int __connman_dnsproxy_init(void)