service: clear ipconfig data and operations on free
authorGrant Erickson <marathon96@gmail.com>
Tue, 19 Jul 2011 00:48:39 +0000 (17:48 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 19 Jul 2011 10:09:25 +0000 (12:09 +0200)
Ensure ipconfig data and operations are cleared out when a service is
freed.

This is at least a partial fix and maybe a full fix for issues 21000
<http://bugs.meego.com/show_bug.cgi?id=21000> and 21285
<http://bugs.meego.com/show_bug.cgi?id=21285>.

src/service.c

index 9a0dbef..792c504 100644 (file)
@@ -2970,11 +2970,15 @@ static void service_free(gpointer user_data)
                connman_provider_unref(service->provider);
 
        if (service->ipconfig_ipv4 != NULL) {
+               connman_ipconfig_set_ops(service->ipconfig_ipv4, NULL);
+               connman_ipconfig_set_data(service->ipconfig_ipv4, NULL);
                connman_ipconfig_unref(service->ipconfig_ipv4);
                service->ipconfig_ipv4 = NULL;
        }
 
        if (service->ipconfig_ipv6 != NULL) {
+               connman_ipconfig_set_ops(service->ipconfig_ipv6, NULL);
+               connman_ipconfig_set_data(service->ipconfig_ipv6, NULL);
                connman_ipconfig_unref(service->ipconfig_ipv6);
                service->ipconfig_ipv6 = NULL;
        }