summaryrefslogtreecommitdiff
path: root/source3/rpcclient/rpcclient.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:32 -0500
commitacf9d61421faa6c0055d57fdee7db300dc5431aa (patch)
tree5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/rpcclient/rpcclient.c
parent3bd3be97dc8a581c0502410453091c195e322766 (diff)
downloadsamba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.bz2
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r--source3/rpcclient/rpcclient.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index bac11f7435..e003b86e67 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -59,10 +59,10 @@ static char **completion_fn(const 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)
@@ -78,7 +78,7 @@ static char **completion_fn(const char *text, int start, int end)
( commands->cmd_set[i].returntype == RPC_RTYPE_WERROR &&
commands->cmd_set[i].wfn)))
{
- matches[count] = strdup(commands->cmd_set[i].name);
+ matches[count] = SMB_STRDUP(commands->cmd_set[i].name);
if (!matches[count])
return NULL;
count++;
@@ -91,7 +91,7 @@ static char **completion_fn(const 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;
@@ -485,7 +485,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;
}