s4:pvfs: fix some talloc related compiler warnings
authorStefan Metzmacher <metze@samba.org>
Wed, 4 Feb 2009 07:50:46 +0000 (08:50 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 5 Feb 2009 16:48:06 +0000 (17:48 +0100)
metze

source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_rename.c
source4/ntvfs/posix/pvfs_resolve.c
source4/ntvfs/posix/pvfs_util.c

index d479f1e2ee0e452ec48243d3a6db4ec7d9e14a68..1adced44aa4e751175d9c4b1a7537a6938da8b1b 100644 (file)
@@ -51,7 +51,7 @@ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
        backends = talloc_realloc(talloc_autofree_context(), backends, struct pvfs_acl_backend, num_backends+1);
        NT_STATUS_HAVE_NO_MEMORY(backends);
 
-       new_ops = talloc_memdup(backends, ops, sizeof(*ops));
+       new_ops = (struct pvfs_acl_ops *)talloc_memdup(backends, ops, sizeof(*ops));
        new_ops->name = talloc_strdup(new_ops, ops->name);
 
        backends[num_backends].ops = new_ops;
index ed90bf3d7bd6d90d8c83b14e2157f128e1df9c7d..800142812296fa732d85d8559673361f0db18e35 100644 (file)
@@ -103,7 +103,7 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx,
        char *dest, *d;
 
        /* the length is bounded by the length of the two strings combined */
-       dest = talloc_size(mem_ctx, strlen(fname) + strlen(pattern) + 1);
+       dest = talloc_array(mem_ctx, char, strlen(fname) + strlen(pattern) + 1);
        if (dest == NULL) {
                return NULL;
        }
@@ -133,6 +133,8 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx,
 
        *d = 0;
 
+       talloc_set_name_const(dest, dest);
+
        return dest;
 }
 
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;
index 09913bc9115adee393dae791ace40c0c5d103492..81ff20a60833ca7c5dc717f6170ea984702e3e7d 100644 (file)
@@ -93,7 +93,7 @@ NTSTATUS pvfs_copy_file(struct pvfs_state *pvfs,
        mode_t mode;
        NTSTATUS status;
        size_t buf_size = 0x10000;
-       char *buf = talloc_size(name2, buf_size);
+       uint8_t *buf = talloc_array(name2, uint8_t, buf_size);
 
        if (buf == NULL) {
                return NT_STATUS_NO_MEMORY;