diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-06 03:06:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:25 -0500 |
commit | ddc10d4d37984246a6547e34a32d629c689c40d1 (patch) | |
tree | bba9f8756de8fe38a6926edd0802aeff25abe0cf /source4/torture/rpc | |
parent | 0b54d9236fad72527ed1bcf4236767a09090d304 (diff) | |
download | samba-ddc10d4d37984246a6547e34a32d629c689c40d1.tar.gz samba-ddc10d4d37984246a6547e34a32d629c689c40d1.tar.bz2 samba-ddc10d4d37984246a6547e34a32d629c689c40d1.zip |
r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.
also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
(This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/echo.c | 8 | ||||
-rw-r--r-- | source4/torture/rpc/netlogon.c | 4 | ||||
-rw-r--r-- | source4/torture/rpc/samsync.c | 4 | ||||
-rw-r--r-- | source4/torture/rpc/schannel.c | 4 | ||||
-rw-r--r-- | source4/torture/rpc/svcctl.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/xplogin.c | 3 |
6 files changed, 12 insertions, 13 deletions
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 5db438afd0..c547c71a83 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -62,8 +62,8 @@ static BOOL test_echodata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) printf("\nTesting EchoData\n"); - data_in = talloc(mem_ctx, len); - data_out = talloc(mem_ctx, len); + data_in = talloc_size(mem_ctx, len); + data_out = talloc_size(mem_ctx, len); for (i=0;i<len;i++) { data_in[i] = i; } @@ -109,7 +109,7 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) printf("\nTesting SourceData\n"); - data_out = talloc(mem_ctx, len); + data_out = talloc_size(mem_ctx, len); r.in.len = len; r.out.data = data_out; @@ -144,7 +144,7 @@ static BOOL test_sinkdata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) printf("\nTesting SinkData\n"); - data_in = talloc(mem_ctx, len); + data_in = talloc_size(mem_ctx, len); for (i=0;i<len;i++) { data_in[i] = i+1; } diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 35f64933a9..93755fd049 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -346,10 +346,10 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) generate_random_buffer(ninfo.challenge, sizeof(ninfo.challenge)); ninfo.nt.length = 24; - ninfo.nt.data = talloc(mem_ctx, 24); + ninfo.nt.data = talloc_size(mem_ctx, 24); SMBNTencrypt(password, ninfo.challenge, ninfo.nt.data); ninfo.lm.length = 24; - ninfo.lm.data = talloc(mem_ctx, 24); + ninfo.lm.data = talloc_size(mem_ctx, 24); SMBencrypt(password, ninfo.challenge, ninfo.lm.data); r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index 171e615196..d90f161849 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -58,7 +58,7 @@ static NTSTATUS test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, sizeof(ninfo.challenge)); if (nt_hash) { ninfo.nt.length = 24; - ninfo.nt.data = talloc(mem_ctx, 24); + ninfo.nt.data = talloc_size(mem_ctx, 24); SMBOWFencrypt(nt_hash->hash, ninfo.challenge, ninfo.nt.data); } else { ninfo.nt.length = 0; @@ -67,7 +67,7 @@ static NTSTATUS test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (lm_hash) { ninfo.lm.length = 24; - ninfo.lm.data = talloc(mem_ctx, 24); + ninfo.lm.data = talloc_size(mem_ctx, 24); SMBOWFencrypt(lm_hash->hash, ninfo.challenge, ninfo.lm.data); } else { ninfo.lm.length = 0; diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c index 75fbe709b5..5ec466f0c1 100644 --- a/source4/torture/rpc/schannel.c +++ b/source4/torture/rpc/schannel.c @@ -79,10 +79,10 @@ static BOOL test_netlogon_ops(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, generate_random_buffer(ninfo.challenge, sizeof(ninfo.challenge)); ninfo.nt.length = 24; - ninfo.nt.data = talloc(mem_ctx, 24); + ninfo.nt.data = talloc_size(mem_ctx, 24); SMBNTencrypt(password, ninfo.challenge, ninfo.nt.data); ninfo.lm.length = 24; - ninfo.lm.data = talloc(mem_ctx, 24); + ninfo.lm.data = talloc_size(mem_ctx, 24); SMBencrypt(password, ninfo.challenge, ninfo.lm.data); diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index efdf60bd3d..256f92b974 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -50,7 +50,7 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) { r.in.buf_size = r.out.bytes_needed; - r.out.service = talloc(mem_ctx, r.out.bytes_needed); + r.out.service = talloc_size(mem_ctx, r.out.bytes_needed); status = dcerpc_svcctl_EnumServicesStatusW(p, mem_ctx, &r); diff --git a/source4/torture/rpc/xplogin.c b/source4/torture/rpc/xplogin.c index 5cd163039f..c50a489e42 100644 --- a/source4/torture/rpc/xplogin.c +++ b/source4/torture/rpc/xplogin.c @@ -730,8 +730,7 @@ static NTSTATUS test_getgroups(struct smbcli_transport *transport, l.in.domain_handle = &domain_handle; l.in.num_rids = g.out.rids->count; - l.in.rids = talloc(mem_ctx, - g.out.rids->count * sizeof(uint32_t)); + l.in.rids = talloc_array_p(mem_ctx, uint32_t, g.out.rids->count); for (i=0; i<g.out.rids->count; i++) l.in.rids[i] = g.out.rids->rid[i].rid; |