summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-08 15:11:28 -0700
committerJeremy Allison <jra@samba.org>2013-04-11 09:49:41 -0700
commitc55eb371144d0ab91b1254b85f2b2a3d4aab8b68 (patch)
treed61d753c644ff119f56b8f8cc616c24553e9d3ca /source3/modules
parentf7756137e8f8a7591c9d95482ca1fca3f6484a51 (diff)
downloadsamba-c55eb371144d0ab91b1254b85f2b2a3d4aab8b68.tar.gz
samba-c55eb371144d0ab91b1254b85f2b2a3d4aab8b68.tar.bz2
samba-c55eb371144d0ab91b1254b85f2b2a3d4aab8b68.zip
Change source3/modules/vfs_dirsort.c from MALLOC -> TALLOC.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_dirsort.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c
index 98472f87a1..813955684a 100644
--- a/source3/modules/vfs_dirsort.c
+++ b/source3/modules/vfs_dirsort.c
@@ -37,10 +37,7 @@ struct dirsort_privates {
};
static void free_dirsort_privates(void **datap) {
- struct dirsort_privates *data = (struct dirsort_privates *) *datap;
- SAFE_FREE(data->directory_list);
- SAFE_FREE(data);
- *datap = NULL;
+ TALLOC_FREE(*datap);
}
static bool open_and_sort_dir (vfs_handle_struct *handle)
@@ -69,9 +66,10 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)
SMB_VFS_NEXT_REWINDDIR(handle, data->source_directory);
/* Set up an array and read the directory entries into it */
- SAFE_FREE(data->directory_list); /* destroy previous cache if needed */
- data->directory_list = (struct dirent *)SMB_MALLOC(
- data->number_of_entries * sizeof(struct dirent));
+ TALLOC_FREE(data->directory_list); /* destroy previous cache if needed */
+ data->directory_list = talloc_zero_array(data,
+ struct dirent,
+ data->number_of_entries);
if (!data->directory_list) {
return false;
}
@@ -95,9 +93,7 @@ static DIR *dirsort_opendir(vfs_handle_struct *handle,
struct dirsort_privates *data = NULL;
/* set up our private data about this directory */
- data = (struct dirsort_privates *)SMB_MALLOC(
- sizeof(struct dirsort_privates));
-
+ data = talloc_zero(handle->conn, struct dirsort_privates);
if (!data) {
return NULL;
}
@@ -130,9 +126,7 @@ static DIR *dirsort_fdopendir(vfs_handle_struct *handle,
struct dirsort_privates *data = NULL;
/* set up our private data about this directory */
- data = (struct dirsort_privates *)SMB_MALLOC(
- sizeof(struct dirsort_privates));
-
+ data = talloc_zero(handle->conn, struct dirsort_privates);
if (!data) {
return NULL;
}
@@ -145,7 +139,7 @@ static DIR *dirsort_fdopendir(vfs_handle_struct *handle,
attr);
if (data->source_directory == NULL) {
- SAFE_FREE(data);
+ TALLOC_FREE(data);
return NULL;
}