diff options
-rw-r--r-- | source4/lib/util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/util.c b/source4/lib/util.c index 1b51fe5e05..2b13cd3d2f 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -610,6 +610,12 @@ char *name_to_fqdn(TALLOC_CTX *mem_ctx, const char *name) char *lock_path(TALLOC_CTX* mem_ctx, const char *name) { char *fname, *dname; + if (name == NULL) { + return NULL; + } + if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) { + return talloc_strdup(mem_ctx, name); + } dname = talloc_strdup(mem_ctx, lp_lockdir()); trim_string(dname,"","/"); |