summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-08-30 22:05:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:55 -0500
commitb5efc738dd45b52bb385e8be5e128c1fe6ecf913 (patch)
tree240a2c8ce898e8163283b9bd2cb04cfdf344d80b /source4
parentb07435f3e186b9e98a430216ba47445ba33069ab (diff)
downloadsamba-b5efc738dd45b52bb385e8be5e128c1fe6ecf913.tar.gz
samba-b5efc738dd45b52bb385e8be5e128c1fe6ecf913.tar.xz
samba-b5efc738dd45b52bb385e8be5e128c1fe6ecf913.zip
r17939: Fix compiler warnings spotted on buildfarm.
rafal (This used to be commit 4803e95c68d8824b5494ee86d626e474d8a0c925)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/libnet/libnet_user.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index 085796130fb..9fc61af2e04 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -281,12 +281,13 @@ BOOL torture_deleteuser(struct torture_context *torture)
status = libnet_DeleteUser(ctx, mem_ctx, &req);
if (!NT_STATUS_IS_OK(status)) {
printf("libnet_DeleteUser call failed: %s\n", nt_errstr(status));
- return False;
+ ret = False;
}
+ talloc_free(mem_ctx);
+
done:
talloc_free(prep_mem_ctx);
- talloc_free(mem_ctx);
return ret;
}
@@ -429,6 +430,9 @@ static void set_test_changes(TALLOC_CTX *mem_ctx, struct libnet_ModifyUser *r, i
r->in.last_password_change = talloc_memdup(mem_ctx, &now, sizeof(now));
fldname = "last_password_change";
break;
+
+ default:
+ fldname = "unknown_field";
}
printf(((i < num_changes - 1) ? "%s," : "%s"), fldname);
@@ -496,17 +500,20 @@ BOOL torture_modifyuser(struct torture_context *torture)
status = libnet_ModifyUser(ctx, mem_ctx, &req);
if (!NT_STATUS_IS_OK(status)) {
printf("libnet_ModifyUser call failed: %s\n", nt_errstr(status));
- return False;
+ talloc_free(mem_ctx);
+ ret = False;
+ goto done;
}
if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, TEST_USERNAME)) {
printf("cleanup failed\n");
- return False;
+ ret = False;
}
+ talloc_free(mem_ctx);
+
done:
talloc_free(prep_mem_ctx);
- talloc_free(mem_ctx);
return ret;
}
@@ -524,7 +531,7 @@ BOOL torture_userinfo_api(struct torture_context *torture)
struct lsa_String domain_name;
struct libnet_UserInfo req;
- prep_mem_ctx = talloc_init("torture user info");
+ prep_mem_ctx = talloc_init("prepare torture user info");
binding = lp_parm_string(-1, "torture", "binding");
ctx = libnet_context_init(NULL);
@@ -548,6 +555,8 @@ BOOL torture_userinfo_api(struct torture_context *torture)
goto done;
}
+ mem_ctx = talloc_init("torture user info");
+
ZERO_STRUCT(req);
req.in.domain_name = domain_name.string;
@@ -557,16 +566,18 @@ BOOL torture_userinfo_api(struct torture_context *torture)
if (!NT_STATUS_IS_OK(status)) {
printf("libnet_UserInfo call failed: %s\n", nt_errstr(status));
ret = False;
+ talloc_free(mem_ctx);
+ goto done;
}
if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, TEST_USERNAME)) {
printf("cleanup failed\n");
ret = False;
- goto done;
}
-done:
talloc_free(ctx);
+
+done:
talloc_free(mem_ctx);
return ret;
}