svn commit: samba r8094 - in branches/SAMBA_4_0/source/torture/libnet: .

mimir at samba.org mimir at samba.org
Sun Jul 3 13:58:48 GMT 2005


Author: mimir
Date: 2005-07-03 13:58:47 +0000 (Sun, 03 Jul 2005)
New Revision: 8094

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8094

Log:
Fix compiler warnings.


rafal


Modified:
   branches/SAMBA_4_0/source/torture/libnet/libnet_lookup.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_lookup.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/libnet_lookup.c	2005-07-03 12:05:07 UTC (rev 8093)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_lookup.c	2005-07-03 13:58:47 UTC (rev 8094)
@@ -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 @@
 
 	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 @@
 
 	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 @@
 
 	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;
 }



More information about the samba-cvs mailing list