diff options
author | Rafal Szczesniak <mimir@samba.org> | 2005-07-03 13:58:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:07 -0500 |
commit | dd36f1332028a2278d2f20bc1df45cca53d9ea08 (patch) | |
tree | fb26207ae4eeb5a79b5e4fba98b43b9663dd0594 | |
parent | b43e2459273f809afc988e6714a90d3038573975 (diff) | |
download | samba-dd36f1332028a2278d2f20bc1df45cca53d9ea08.tar.gz samba-dd36f1332028a2278d2f20bc1df45cca53d9ea08.tar.bz2 samba-dd36f1332028a2278d2f20bc1df45cca53d9ea08.zip |
r8094: Fix compiler warnings.
rafal
(This used to be commit cca6d792945477b86b2dd91f3c90152b69ee2a15)
-rw-r--r-- | source4/torture/libnet/libnet_lookup.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c index 42baacc1cb..320b3c11cc 100644 --- a/source4/torture/libnet/libnet_lookup.c +++ b/source4/torture/libnet/libnet_lookup.c @@ -29,17 +29,20 @@ BOOL torture_lookup(void) { + BOOL ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; struct libnet_Lookup lookup; - const char address[16]; + const char *address; mem_ctx = talloc_init("test_lookup"); ctx = libnet_context_init(NULL); ctx->cred = cmdline_credentials; + address = talloc_array(ctx, const char, 16); + lookup.in.hostname = lp_netbios_name(); lookup.in.methods = lp_name_resolve_order(); lookup.in.type = NBT_NAME_CLIENT; @@ -49,26 +52,34 @@ BOOL torture_lookup(void) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup name %s: %s\n", lookup.in.hostname, nt_errstr(status)); - return False; + ret = False; + goto done; } - return True; + ret = True; + +done: + talloc_free(mem_ctx); + return ret; } BOOL torture_lookup_host(void) { + BOOL ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; struct libnet_Lookup lookup; - const char address[16]; + const char *address; mem_ctx = talloc_init("test_lookup_host"); ctx = libnet_context_init(NULL); ctx->cred = cmdline_credentials; + address = talloc_array(mem_ctx, const char, 16); + lookup.in.hostname = lp_netbios_name(); lookup.in.methods = lp_name_resolve_order(); lookup.out.address = &address; @@ -77,26 +88,34 @@ BOOL torture_lookup_host(void) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup host %s: %s\n", lookup.in.hostname, nt_errstr(status)); - return False; + ret = False; + goto done; } - return True; + ret = True; + +done: + talloc_free(mem_ctx); + return ret; } BOOL torture_lookup_pdc(void) { + BOOL ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; struct libnet_Lookup lookup; - const char address[16]; + const char *address; mem_ctx = talloc_init("test_lookup_pdc"); ctx = libnet_context_init(NULL); ctx->cred = cmdline_credentials; + address = talloc_array(mem_ctx, const char, 16); + lookup.in.hostname = lp_workgroup(); lookup.in.methods = lp_name_resolve_order(); lookup.out.address = &address; @@ -105,8 +124,13 @@ BOOL torture_lookup_pdc(void) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup pdc %s: %s\n", lookup.in.hostname, nt_errstr(status)); - return False; + ret = False; + goto done; } - return True; + ret = True; + +done: + talloc_free(mem_ctx); + return ret; } |