vpn: Clear the data pointer from provider when destroying
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Thu, 7 Mar 2013 16:13:38 +0000 (18:13 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 8 Mar 2013 11:49:57 +0000 (13:49 +0200)
If the data pointer is left around, then vpn plugin might
accidentally use it if dbus messages are received after
we have cleared the vpn connection.

plugins/vpn.c

index cbba396..f60a658 100644 (file)
@@ -1438,6 +1438,8 @@ static void destroy_provider(struct connection_data *data)
        if (data->call != NULL)
                dbus_pending_call_cancel(data->call);
 
+       connman_provider_set_data(data->provider, NULL);
+
        connman_provider_put(data->provider);
 
        data->provider = NULL;