--- plugins/vpn.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/plugins/vpn.c b/plugins/vpn.c index ada15aa..e442306 100644 --- a/plugins/vpn.c +++ b/plugins/vpn.c @@ -351,9 +351,12 @@ static int vpn_connect(struct connman_provider *provider) vpn_driver_data = g_hash_table_lookup(driver_hash, name); - if (vpn_driver_data != NULL && vpn_driver_data->vpn_driver != NULL && - vpn_driver_data->vpn_driver->flags != VPN_FLAG_NO_TUN) { + if (vpn_driver_data == NULL || vpn_driver_data->vpn_driver == NULL) { + ret = -EINVAL; + goto exist_err; + } + if (vpn_driver_data->vpn_driver->flags != VPN_FLAG_NO_TUN) { ret = vpn_create_tun(provider); if (ret < 0) goto exist_err; -- 1.7.5.4 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman