diff options
author | Andreas Schneider <asn@samba.org> | 2013-12-04 14:01:54 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-12-06 01:14:09 +0100 |
commit | 4f06c681b91446f4e85d7e46bdb20b25bf222aad (patch) | |
tree | 29172b4886463cac1638448376d343d877b006e2 /source4/torture/raw | |
parent | b871c3907afe666ff7195c2906b43011138e4bf7 (diff) | |
download | samba-4f06c681b91446f4e85d7e46bdb20b25bf222aad.tar.gz |
s4-torture: Use talloc for asprintf.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/setfileinfo.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c index 95ce060177e..a08191d0bf2 100644 --- a/source4/torture/raw/setfileinfo.c +++ b/source4/torture/raw/setfileinfo.c @@ -36,7 +36,6 @@ torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state bool ret = true; int fnum = -1; char *fnum_fname; - char *fnum_fname_new; char *path_fname; char *path_fname_new; union smb_fileinfo finfo1, finfo2; @@ -47,10 +46,9 @@ torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state bool check_fnum; int n = time(NULL) % 100; - asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n); - asprintf(&path_fname_new, BASEDIR "\\fname_test_new_%d.txt", n); - asprintf(&fnum_fname, BASEDIR "\\fnum_test_%d.txt", n); - asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n); + path_fname = talloc_asprintf(torture, BASEDIR "\\fname_test_%d.txt", n); + path_fname_new = talloc_asprintf(torture, BASEDIR "\\fname_test_new_%d.txt", n); + fnum_fname = talloc_asprintf(torture, BASEDIR "\\fnum_test_%d.txt", n); torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); @@ -481,13 +479,13 @@ torture_raw_sfileinfo_rename(struct torture_context *torture, const char *call_name; bool check_fnum; int n = time(NULL) % 100; - - asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n); - asprintf(&path_fname_new, BASEDIR "\\fname_test_new_%d.txt", n); - asprintf(&fnum_fname, BASEDIR "\\fnum_test_%d.txt", n); - asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n); - asprintf(&path_dname, BASEDIR "\\dname_test_%d", n); - asprintf(&path_dname_new, BASEDIR "\\dname_test_new_%d", n); + + path_fname = talloc_asprintf(torture, BASEDIR "\\fname_test_%d.txt", n); + path_fname_new = talloc_asprintf(torture, BASEDIR "\\fname_test_new_%d.txt", n); + fnum_fname = talloc_asprintf(torture, BASEDIR "\\fnum_test_%d.txt", n); + fnum_fname_new = talloc_asprintf(torture, BASEDIR "\\fnum_test_new_%d.txt", n); + path_dname = talloc_asprintf(torture, BASEDIR "\\dname_test_%d", n); + path_dname_new = talloc_asprintf(torture, BASEDIR "\\dname_test_new_%d", n); torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); |