Data might be NULL if called from vpn_died, so check it and do
nothing if it is NULL.
---
 vpn/plugins/vpn.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index 60954be..1b5af6e 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -199,6 +199,8 @@ static int vpn_set_state(struct vpn_provider *provider,
                                                enum vpn_provider_state state)
 {
        struct vpn_data *data = vpn_provider_get_data(provider);
+       if (!data)
+               return -EINVAL;
 
        switch (state) {
        case VPN_PROVIDER_STATE_UNKNOWN:
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to