diff options
Diffstat (limited to 'vpn/vpn-provider.c')
-rwxr-xr-x | vpn/vpn-provider.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index 8d2836ef..d29b0186 100755 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -2167,9 +2167,10 @@ char *__vpn_provider_create_identifier(const char *host, const char *domain) { char *ident; - ident = g_strdup_printf("%s_%s", host, domain); - if (!ident) - return NULL; + if (domain) + ident = g_strdup_printf("%s_%s", host, domain); + else + ident = g_strdup_printf("%s", host); provider_dbus_ident(ident); @@ -2180,7 +2181,10 @@ char *__vpn_provider_create_identifier(const char *host, const char *domain, con { char *ident; - ident = g_strdup_printf("%s_%s_%s", host, domain, name); + if (domain) + ident = g_strdup_printf("%s_%s_%s", host, domain, name); + else + ident = g_strdup_printf("%s_%s", host, name); if (!ident) return NULL; @@ -2234,7 +2238,7 @@ int __vpn_provider_create(DBusMessage *msg) dbus_message_iter_next(&array); } - if (!host || !domain) + if (!host) return -EINVAL; DBG("Type %s name %s networks %p", type, name, networks); @@ -2423,7 +2427,7 @@ int __vpn_provider_create_from_config(GHashTable *settings, networks_str = get_string(settings, "Networks"); networks = parse_user_networks(networks_str); - if (!host || !domain) { + if (!host) { err = -EINVAL; goto fail; } |