diff options
author | Jeremy Allison <jra@samba.org> | 2004-12-07 18:25:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:32 -0500 |
commit | acf9d61421faa6c0055d57fdee7db300dc5431aa (patch) | |
tree | 5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/rpcclient/cmd_spoolss.c | |
parent | 3bd3be97dc8a581c0502410453091c195e322766 (diff) | |
download | samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.xz 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/cmd_spoolss.c')
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 4c4704c4ae6..0b0d015238e 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -1333,7 +1333,7 @@ static BOOL init_drv_info_3_members ( /* allocate the space; add one extra slot for a terminating NULL. Each filename is NULL terminated and the end contains a double NULL */ - if ((info->dependentfiles=(uint16*)talloc(mem_ctx, (len+1)*sizeof(uint16))) == NULL) + if ((info->dependentfiles=TALLOC_ARRAY(mem_ctx, uint16, len+1)) == NULL) { DEBUG(0,("init_drv_info_3_members: Unable to malloc memory for dependenfiles\n")); return False; @@ -2035,7 +2035,7 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli, fstrcpy(value.valuename, argv[2]); value.type = REG_SZ; value.size = data.uni_str_len * 2; - value.data_p = talloc_memdup(mem_ctx, data.buffer, value.size); + value.data_p = TALLOC_MEMDUP(mem_ctx, data.buffer, value.size); result = cli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value); @@ -2417,8 +2417,7 @@ static WERROR cmd_spoolss_rffpcnex(struct cli_state *cli, option.option_type_ptr = 1; option.count = option.ctr.count = 2; - option.ctr.type = (SPOOL_NOTIFY_OPTION_TYPE *)talloc( - mem_ctx, sizeof(SPOOL_NOTIFY_OPTION_TYPE) * 2); + option.ctr.type = TALLOC_ARRAY(mem_ctx, SPOOL_NOTIFY_OPTION_TYPE, 2); ZERO_STRUCT(option.ctr.type[0]); option.ctr.type[0].type = PRINTER_NOTIFY_TYPE; |