s4-torture: allow host-only in unc lists in smbtorture
[ira/wip.git] / source4 / libcli / cliconnect.c
index 14935dadbab16c155905cdb8633ef9d751bb7010..1a5bd607b48b2fedbed6d4adffe98c77418b5d88 100644 (file)
@@ -238,13 +238,13 @@ bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
 {
        char *p;
 
-       *hostname = *sharename = NULL;
-
        if (strncmp(unc_name, "\\\\", 2) &&
            strncmp(unc_name, "//", 2)) {
                return false;
        }
 
+       *hostname = *sharename = NULL;
+
        *hostname = talloc_strdup(mem_ctx, &unc_name[2]);
        p = terminate_path_at_separator(*hostname);