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/gentest.c | |
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/gentest.c')
-rw-r--r-- | source4/torture/gentest.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 01b4022d32..5d8c7bf8fd 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -1330,8 +1330,8 @@ static BOOL handler_readx(int instance) parm[0].readx.in.mincnt = gen_io_count(); parm[0].readx.in.maxcnt = gen_io_count(); parm[0].readx.in.remaining = gen_io_count(); - parm[0].readx.out.data = talloc(current_op.mem_ctx, - MAX(parm[0].readx.in.mincnt, parm[0].readx.in.maxcnt)); + parm[0].readx.out.data = talloc_size(current_op.mem_ctx, + MAX(parm[0].readx.in.mincnt, parm[0].readx.in.maxcnt)); GEN_COPY_PARM; GEN_SET_FNUM(readx.in.fnum); @@ -1392,8 +1392,9 @@ static BOOL handler_lockingx(int instance) } while (nlocks == 0); if (nlocks > 0) { - parm[0].lockx.in.locks = talloc(current_op.mem_ctx, - sizeof(parm[0].lockx.in.locks[0]) * nlocks); + parm[0].lockx.in.locks = talloc_array_p(current_op.mem_ctx, + struct smb_lock_entry, + nlocks); for (n=0;n<nlocks;n++) { parm[0].lockx.in.locks[n].pid = gen_pid(); parm[0].lockx.in.locks[n].offset = gen_offset(); |