X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=vpn%2Fvpn-provider.c;h=d29b018619e02291631fe8e272ea790f52bc2db3;hb=cef237e5250062e3943724b36c06f585cafee10b;hp=8d2836efe0c2718385115785bfd4bf19dbb21565;hpb=a4047324d2ce8e10e74a8a9ca6c0d5062b6ecc5d;p=platform%2Fupstream%2Fconnman.git diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index 8d2836e..d29b018 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; }