diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-05-07 06:59:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:49 -0500 |
commit | 55739e9f860a2a8f27a99fc2f79905a8ed143fee (patch) | |
tree | 814befcf2b106109cc180b6dbd475291da3ecd18 /source3/torture/vfstest.c | |
parent | bce78238fb84c201a9bdc6ee88a6ced38ee26768 (diff) | |
download | samba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.tar.gz samba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.tar.bz2 samba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.zip |
r6640: Attempt to fix 'make everything' with the paranoid malloc checker.
Volker
(This used to be commit 3db2799822da3711b47b60ba13daa07205ced45f)
Diffstat (limited to 'source3/torture/vfstest.c')
-rw-r--r-- | source3/torture/vfstest.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 3296a66096..69acd01c1a 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -52,10 +52,10 @@ static char **completion_fn(char *text, int start, int end) if (!commands) return NULL; - matches = (char **)malloc(sizeof(matches[0])*MAX_COMPLETIONS); + matches = SMB_MALLOC_ARRAY(char *, MAX_COMPLETIONS); if (!matches) return NULL; - matches[count++] = strdup(text); + matches[count++] = SMB_STRDUP(text); if (!matches[0]) return NULL; while (commands && count < MAX_COMPLETIONS-1) @@ -68,7 +68,7 @@ static char **completion_fn(char *text, int start, int end) if ((strncmp(text, commands->cmd_set[i].name, strlen(text)) == 0) && commands->cmd_set[i].fn) { - matches[count] = strdup(commands->cmd_set[i].name); + matches[count] = SMB_STRDUP(commands->cmd_set[i].name); if (!matches[count]) return NULL; count++; @@ -81,7 +81,7 @@ static char **completion_fn(char *text, int start, int end) if (count == 2) { SAFE_FREE(matches[0]); - matches[0] = strdup(matches[1]); + matches[0] = SMB_STRDUP(matches[1]); } matches[count] = NULL; return matches; @@ -248,7 +248,7 @@ static void add_command_set(struct cmd_set *cmd_set) { struct cmd_list *entry; - if (!(entry = (struct cmd_list *)malloc(sizeof(struct cmd_list)))) { + if (!(entry = SMB_MALLOC_P(struct cmd_list))) { DEBUG(0, ("out of memory\n")); return; } @@ -274,7 +274,7 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c again: while(next_token(&p, buf, " ", sizeof(buf))) { if (argv) { - argv[argc] = strdup(buf); + argv[argc] = SMB_STRDUP(buf); } argc++; @@ -284,7 +284,7 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c /* Create argument list */ - argv = (char **)malloc(sizeof(char *) * argc); + argv = SMB_MALLOC_ARRAY(char *, argc); memset(argv, 0, sizeof(char *) * argc); if (!argv) { |