From 2234173220c51c2e37818149ddf41421672904c0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Jan 2009 11:38:24 -0800 Subject: Fix warnings in make test code. Jeremy. --- source3/torture/torture.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'source3/torture/torture.c') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 63942da2e5..3261e78d44 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -1213,7 +1213,9 @@ static bool run_tcon2_test(int dummy) printf("starting tcon2 test\n"); - asprintf(&service, "\\\\%s\\%s", host, share); + if (asprintf(&service, "\\\\%s\\%s", host, share) == -1) { + return false; + } status = cli_raw_tcon(cli, service, password, "?????", &max_xmit, &cnum); @@ -5280,8 +5282,13 @@ static bool run_local_rbtree(int dummy) for (i=0; i<1000; i++) { char *key, *value; - asprintf(&key, "key%ld", random()); - asprintf(&value, "value%ld", random()); + if (asprintf(&key, "key%ld", random()) == -1) { + goto done; + } + if (asprintf(&value, "value%ld", random()) == -1) { + SAFE_FREE(key); + goto done; + } if (!rbt_testval(db, key, value)) { SAFE_FREE(key); @@ -5290,7 +5297,10 @@ static bool run_local_rbtree(int dummy) } SAFE_FREE(value); - asprintf(&value, "value%ld", random()); + if (asprintf(&value, "value%ld", random()) == -1) { + SAFE_FREE(key); + goto done; + } if (!rbt_testval(db, key, value)) { SAFE_FREE(key); -- cgit