s4:pvfs: fix some talloc related compiler warnings
[ira/wip.git] / source4 / ntvfs / posix / pvfs_resolve.c
index 43547c275b502614a15313f2087c1fdfa6009f63..c33323350e0d2b755be8e74838f8af2b93410567 100644 (file)
@@ -464,7 +464,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
        }
 
        /* rebuild the name */
-       ret = talloc_size(mem_ctx, len+1);
+       ret = talloc_array(mem_ctx, char, len+1);
        if (ret == NULL) {
                talloc_free(s);
                return NT_STATUS_NO_MEMORY;
@@ -478,6 +478,8 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
        }       
        ret[len] = 0;
 
+       talloc_set_name_const(ret, ret);
+
        talloc_free(s);
 
        *fname = ret;