When VPN dies we clear rtnl watch and unref the provider. The
unref needs to be done after the watch has been removed, otherwise
it is possible that we try to access already freed provider data
from rtnl watcher if new rtnl event is received.
---
vpn/plugins/vpn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index b407573..080086d 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -138,9 +138,9 @@ void vpn_died(struct connman_task *task, int exit_code,
void *user_data)
vpn_provider_set_data(provider, NULL);
if (data->watch != 0) {
- vpn_provider_unref(provider);
vpn_rtnl_remove_watch(data->watch);
data->watch = 0;
+ vpn_provider_unref(provider);
}
vpn_exit:
--
1.8.3.1
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman