svn commit: samba r24943 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

vlendec at samba.org vlendec at samba.org
Tue Sep 4 05:39:08 GMT 2007


Author: vlendec
Date: 2007-09-04 05:39:06 +0000 (Tue, 04 Sep 2007)
New Revision: 24943

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

Log:
Some stackframes
Modified:
   branches/SAMBA_3_2/source/utils/nmblookup.c
   branches/SAMBA_3_2/source/utils/pdbedit.c
   branches/SAMBA_3_2/source/utils/sharesec.c
   branches/SAMBA_3_2/source/utils/smbcacls.c
   branches/SAMBA_3_2/source/utils/smbcquotas.c
   branches/SAMBA_3_2/source/utils/smbfilter.c
   branches/SAMBA_3_2/source/utils/smbget.c
   branches/SAMBA_3_2/source/utils/smbpasswd.c
   branches/SAMBA_3_2/source/utils/smbtree.c
   branches/SAMBA_3_2_0/source/utils/nmblookup.c
   branches/SAMBA_3_2_0/source/utils/pdbedit.c
   branches/SAMBA_3_2_0/source/utils/sharesec.c
   branches/SAMBA_3_2_0/source/utils/smbcacls.c
   branches/SAMBA_3_2_0/source/utils/smbcquotas.c
   branches/SAMBA_3_2_0/source/utils/smbfilter.c
   branches/SAMBA_3_2_0/source/utils/smbget.c
   branches/SAMBA_3_2_0/source/utils/smbpasswd.c
   branches/SAMBA_3_2_0/source/utils/smbtree.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/nmblookup.c
===================================================================
--- branches/SAMBA_3_2/source/utils/nmblookup.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/nmblookup.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -193,6 +193,7 @@
   static BOOL find_master=False;
   static BOOL lookup_by_ip = False;
   poptContext pc;
+  TALLOC_CTX *frame = talloc_stackframe();
 
   struct poptOption long_options[] = {
 	  POPT_AUTOHELP
@@ -292,6 +293,6 @@
   }
 
   poptFreeContext(pc);
-
+  TALLOC_FREE(frame);
   return(0);
 }

Modified: branches/SAMBA_3_2/source/utils/pdbedit.c
===================================================================
--- branches/SAMBA_3_2/source/utils/pdbedit.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/pdbedit.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -758,6 +758,7 @@
 	static BOOL pw_from_stdin = False;
 	struct pdb_methods *bin, *bout, *bdef;
 	char *configfile = NULL;
+	TALLOC_CTX *frame = talloc_stackframe();
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -798,6 +799,7 @@
 	/* we shouldn't have silly checks like this */
 	if (getuid() != 0) {
 		d_fprintf(stderr, "You must be root to use pdbedit\n");
+		TALLOC_FREE(frame);
 		return -1;
 	}
 	
@@ -1050,5 +1052,6 @@
 	}
 	poptPrintHelp(pc, stderr, 0);
 
+	TALLOC_FREE(frame);
 	return 1;
 }

Modified: branches/SAMBA_3_2/source/utils/sharesec.c
===================================================================
--- branches/SAMBA_3_2/source/utils/sharesec.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/sharesec.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -507,7 +507,7 @@
 		{ NULL }
 	};
 
-	if ( !(ctx = talloc_init("main")) ) {
+	if ( !(ctx = talloc_stackframe()) ) {
 		fprintf( stderr, "Failed to initialize talloc context!\n");
 		return -1;
 	}

Modified: branches/SAMBA_3_2/source/utils/smbcacls.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbcacls.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbcacls.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -824,7 +824,7 @@
 
 	load_case_tables();
 
-	ctx=talloc_init("main");
+	ctx=talloc_stackframe();
 
 	/* set default debug level to 1 regardless of what smb.conf sets */
 	setup_logging( "smbcacls", True );

Modified: branches/SAMBA_3_2/source/utils/smbcquotas.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbcquotas.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbcquotas.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -401,6 +401,7 @@
 	struct cli_state *cli;
 	BOOL fix_user = False;
 	SMB_NTQUOTA_STRUCT qt;
+	TALLOC_CTX *frame = talloc_stackframe();
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -544,6 +545,8 @@
 			break;
 	}
 
+	talloc_free(frame);
+
 	return result;
 }
 

Modified: branches/SAMBA_3_2/source/utils/smbfilter.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbfilter.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbfilter.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -220,6 +220,7 @@
 {
 	char *desthost;
 	pstring configfile;
+	TALLOC_CTX *frame = talloc_stackframe();
 
 	setup_logging(argv[0],True);
   
@@ -240,5 +241,6 @@
 	}
 
 	start_filter(desthost);
+	TALLOC_FREE(frame);
 	return 0;
 }

Modified: branches/SAMBA_3_2/source/utils/smbget.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbget.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbget.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -521,6 +521,7 @@
 	int c = 0;
 	const char *file = NULL;
 	char *rcfile = NULL;
+	TALLOC_CTX *frame = talloc_stackframe();
 	struct poptOption long_options[] = {
 		{"guest", 'a', POPT_ARG_NONE, NULL, 'a', "Work as user guest" },	
 		{"resume", 'r', POPT_ARG_NONE, &_resume, 0, "Automatically resume aborted files" },
@@ -597,6 +598,6 @@
 	}
 
 	clean_exit();
-
+	TALLOC_FREE(frame);
 	return 0;
 }

Modified: branches/SAMBA_3_2/source/utils/smbpasswd.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbpasswd.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbpasswd.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -550,7 +550,9 @@
 **********************************************************/
 int main(int argc, char **argv)
 {	
+	TALLOC_CTX *frame = talloc_stackframe();
 	int local_flags = 0;
+	int ret;
 	
 	AllowDebugChange = False;
 
@@ -587,5 +589,7 @@
 		return process_root(local_flags);
 	} 
 
-	return process_nonroot(local_flags);
+	ret = process_nonroot(local_flags);
+	TALLOC_FREE(frame);
+	return ret;
 }

Modified: branches/SAMBA_3_2/source/utils/smbtree.c
===================================================================
--- branches/SAMBA_3_2/source/utils/smbtree.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbtree.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -249,6 +249,7 @@
 ****************************************************************************/
  int main(int argc,char *argv[])
 {
+	TALLOC_CTX *frame = talloc_stackframe();
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
 		{ "broadcast", 'b', POPT_ARG_VAL, &use_bcast, True, "Use broadcast instead of using the master browser" },
@@ -289,8 +290,11 @@
 
 	/* Now do our stuff */
 
-        if (!print_tree(&cmdline_auth_info))
+        if (!print_tree(&cmdline_auth_info)) {
+		TALLOC_FREE(frame);
                 return 1;
+	}
 
+	TALLOC_FREE(frame);
 	return 0;
 }

Modified: branches/SAMBA_3_2_0/source/utils/nmblookup.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/nmblookup.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/nmblookup.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -193,6 +193,7 @@
   static BOOL find_master=False;
   static BOOL lookup_by_ip = False;
   poptContext pc;
+  TALLOC_CTX *frame = talloc_stackframe();
 
   struct poptOption long_options[] = {
 	  POPT_AUTOHELP
@@ -292,6 +293,6 @@
   }
 
   poptFreeContext(pc);
-
+  TALLOC_FREE(frame);
   return(0);
 }

Modified: branches/SAMBA_3_2_0/source/utils/pdbedit.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/pdbedit.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/pdbedit.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -758,6 +758,7 @@
 	static BOOL pw_from_stdin = False;
 	struct pdb_methods *bin, *bout, *bdef;
 	char *configfile = NULL;
+	TALLOC_CTX *frame = talloc_stackframe();
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -798,6 +799,7 @@
 	/* we shouldn't have silly checks like this */
 	if (getuid() != 0) {
 		d_fprintf(stderr, "You must be root to use pdbedit\n");
+		TALLOC_FREE(frame);
 		return -1;
 	}
 	
@@ -1049,5 +1051,6 @@
 	}
 	poptPrintHelp(pc, stderr, 0);
 
+	TALLOC_FREE(frame);
 	return 1;
 }

Modified: branches/SAMBA_3_2_0/source/utils/sharesec.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/sharesec.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/sharesec.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -507,7 +507,7 @@
 		{ NULL }
 	};
 
-	if ( !(ctx = talloc_init("main")) ) {
+	if ( !(ctx = talloc_stackframe()) ) {
 		fprintf( stderr, "Failed to initialize talloc context!\n");
 		return -1;
 	}

Modified: branches/SAMBA_3_2_0/source/utils/smbcacls.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbcacls.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbcacls.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -824,7 +824,7 @@
 
 	load_case_tables();
 
-	ctx=talloc_init("main");
+	ctx=talloc_stackframe();
 
 	/* set default debug level to 1 regardless of what smb.conf sets */
 	setup_logging( "smbcacls", True );

Modified: branches/SAMBA_3_2_0/source/utils/smbcquotas.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbcquotas.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbcquotas.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -401,6 +401,7 @@
 	struct cli_state *cli;
 	BOOL fix_user = False;
 	SMB_NTQUOTA_STRUCT qt;
+	TALLOC_CTX *frame = talloc_stackframe();
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -544,6 +545,8 @@
 			break;
 	}
 
+	talloc_free(frame);
+
 	return result;
 }
 

Modified: branches/SAMBA_3_2_0/source/utils/smbfilter.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbfilter.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbfilter.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -220,6 +220,7 @@
 {
 	char *desthost;
 	pstring configfile;
+	TALLOC_CTX *frame = talloc_stackframe();
 
 	setup_logging(argv[0],True);
   
@@ -240,5 +241,6 @@
 	}
 
 	start_filter(desthost);
+	TALLOC_FREE(frame);
 	return 0;
 }

Modified: branches/SAMBA_3_2_0/source/utils/smbget.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbget.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbget.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -521,6 +521,7 @@
 	int c = 0;
 	const char *file = NULL;
 	char *rcfile = NULL;
+	TALLOC_CTX *frame = talloc_stackframe();
 	struct poptOption long_options[] = {
 		{"guest", 'a', POPT_ARG_NONE, NULL, 'a', "Work as user guest" },	
 		{"resume", 'r', POPT_ARG_NONE, &_resume, 0, "Automatically resume aborted files" },
@@ -597,6 +598,6 @@
 	}
 
 	clean_exit();
-
+	TALLOC_FREE(frame);
 	return 0;
 }

Modified: branches/SAMBA_3_2_0/source/utils/smbpasswd.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbpasswd.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbpasswd.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -550,7 +550,9 @@
 **********************************************************/
 int main(int argc, char **argv)
 {	
+	TALLOC_CTX *frame = talloc_stackframe();
 	int local_flags = 0;
+	int ret;
 	
 	AllowDebugChange = False;
 
@@ -587,5 +589,7 @@
 		return process_root(local_flags);
 	} 
 
-	return process_nonroot(local_flags);
+	ret = process_nonroot(local_flags);
+	TALLOC_FREE(frame);
+	return ret;
 }

Modified: branches/SAMBA_3_2_0/source/utils/smbtree.c
===================================================================
--- branches/SAMBA_3_2_0/source/utils/smbtree.c	2007-09-04 02:22:04 UTC (rev 24942)
+++ branches/SAMBA_3_2_0/source/utils/smbtree.c	2007-09-04 05:39:06 UTC (rev 24943)
@@ -247,6 +247,7 @@
 ****************************************************************************/
  int main(int argc,char *argv[])
 {
+	TALLOC_CTX *frame = talloc_stackframe();
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
 		{ "broadcast", 'b', POPT_ARG_VAL, &use_bcast, True, "Use broadcast instead of using the master browser" },
@@ -287,8 +288,11 @@
 
 	/* Now do our stuff */
 
-        if (!print_tree(&cmdline_auth_info))
+        if (!print_tree(&cmdline_auth_info)) {
+		TALLOC_FREE(frame);
                 return 1;
+	}
 
+	TALLOC_FREE(frame);
 	return 0;
 }



More information about the samba-cvs mailing list