summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-04-05 17:15:29 +0200
committerMichael Adam <obnox@samba.org>2016-05-13 00:16:16 +0200
commitebfbf6bc2781510524530a9a98bec57b87421c72 (patch)
treeb7f587d48d82486144bbc6b99aedcba051265709 /source4
parenta6db0527cbb606fea7263f99cf496e5faa9529a0 (diff)
downloadsamba-ebfbf6bc2781510524530a9a98bec57b87421c72.tar.gz
s4:torture:basic: fix O3 error unused result of asprintf
in run_opentest() While fixing this, also convert to using talloc_asprintf instead. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/basic/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 8f51253db77..737c799358f 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -824,7 +824,9 @@ static bool run_vuidtest(struct torture_context *tctx,
int failures = 0;
int i;
- asprintf(&control_char_fname, "\\readonly.afile");
+ control_char_fname = talloc_strdup(tctx, "\\readonly.afile");
+ torture_assert_not_null(tctx, control_char_fname, "asprintf failed\n");
+
for (i = 1; i <= 0x1f; i++) {
control_char_fname[10] = i;
fnum1 = smbcli_nt_create_full(cli1->tree, control_char_fname, 0, SEC_FILE_WRITE_DATA, FILE_ATTRIBUTE_NORMAL,
@@ -843,7 +845,7 @@ static bool run_vuidtest(struct torture_context *tctx,
smbcli_setatr(cli1->tree, control_char_fname, 0, 0);
smbcli_unlink(cli1->tree, control_char_fname);
}
- free(control_char_fname);
+ TALLOC_FREE(control_char_fname);
if (!failures)
torture_comment(tctx, "Create file with control char names passed.\n");