diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-07 04:39:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:30 -0500 |
commit | 11ce2cfd70df264c5c91b4daaa9a01c5abc673b0 (patch) | |
tree | f00bf95389509ca8655f3b1cf1dfec76289790b3 /source4/ntvfs/posix | |
parent | 066134f2414e8688fd980b619f9e597538c8766d (diff) | |
download | samba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.tar.gz samba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.tar.bz2 samba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.zip |
r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions
- fixes the code that broke from the above
while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_dirlist.c | 6 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_streams.c | 4 | ||||
-rw-r--r-- | source4/ntvfs/posix/xattr_system.c | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c index 5c67b2d189..c2e8f826a2 100644 --- a/source4/ntvfs/posix/pvfs_dirlist.c +++ b/source4/ntvfs/posix/pvfs_dirlist.c @@ -137,9 +137,9 @@ NTSTATUS pvfs_list_start(struct pvfs_state *pvfs, struct pvfs_filename *name, dir->no_wildcard = False; dir->end_of_search = False; dir->offset = 0; - dir->name_cache = talloc_zero_array_p(dir, - struct name_cache_entry, - NAME_CACHE_SIZE); + dir->name_cache = talloc_zero_array(dir, + struct name_cache_entry, + NAME_CACHE_SIZE); if (dir->name_cache == NULL) { talloc_free(dir); return NT_STATUS_NO_MEMORY; diff --git a/source4/ntvfs/posix/pvfs_streams.c b/source4/ntvfs/posix/pvfs_streams.c index 12f783e172..e92732b810 100644 --- a/source4/ntvfs/posix/pvfs_streams.c +++ b/source4/ntvfs/posix/pvfs_streams.c @@ -283,7 +283,7 @@ ssize_t pvfs_stream_write(struct pvfs_state *pvfs, blob = data_blob(NULL, 0); } if (count+offset > blob.length) { - blob.data = talloc_realloc(blob.data, blob.data, count+offset); + blob.data = talloc_realloc(blob.data, blob.data, uint8_t, count+offset); if (blob.data == NULL) { errno = ENOMEM; return -1; @@ -339,7 +339,7 @@ NTSTATUS pvfs_stream_truncate(struct pvfs_state *pvfs, if (length <= blob.length) { blob.length = length; } else if (length > blob.length) { - blob.data = talloc_realloc(blob.data, blob.data, length); + blob.data = talloc_realloc(blob.data, blob.data, uint8_t, length); if (blob.data == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/ntvfs/posix/xattr_system.c b/source4/ntvfs/posix/xattr_system.c index c86ee0bd87..f19177f44c 100644 --- a/source4/ntvfs/posix/xattr_system.c +++ b/source4/ntvfs/posix/xattr_system.c @@ -51,7 +51,8 @@ again: } if (ret == -1 && errno == ERANGE) { estimated_size *= 2; - blob->data = talloc_realloc(mem_ctx, blob->data, estimated_size); + blob->data = talloc_realloc(mem_ctx, blob->data, + uint8_t, estimated_size); if (blob->data == NULL) { return NT_STATUS_NO_MEMORY; } |