1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r24943: Some stackframes

This commit is contained in:
Volker Lendecke 2007-09-04 05:39:06 +00:00 committed by Gerald (Jerry) Carter
parent 62426a0555
commit cddb9f11d5
9 changed files with 24 additions and 6 deletions

View File

@ -193,6 +193,7 @@ int main(int argc,char *argv[])
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 @@ int main(int argc,char *argv[])
}
poptFreeContext(pc);
TALLOC_FREE(frame);
return(0);
}

View File

@ -758,6 +758,7 @@ int main (int argc, char **argv)
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 @@ int main (int argc, char **argv)
/* 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 @@ int main (int argc, char **argv)
}
poptPrintHelp(pc, stderr, 0);
TALLOC_FREE(frame);
return 1;
}

View File

@ -507,7 +507,7 @@ int main(int argc, const char *argv[])
{ NULL }
};
if ( !(ctx = talloc_init("main")) ) {
if ( !(ctx = talloc_stackframe()) ) {
fprintf( stderr, "Failed to initialize talloc context!\n");
return -1;
}

View File

@ -824,7 +824,7 @@ static struct cli_state *connect_one(const char *share)
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 );

View File

@ -401,6 +401,7 @@ static struct cli_state *connect_one(const char *share)
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 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
break;
}
talloc_free(frame);
return result;
}

View File

@ -220,6 +220,7 @@ int main(int argc, char *argv[])
{
char *desthost;
pstring configfile;
TALLOC_CTX *frame = talloc_stackframe();
setup_logging(argv[0],True);
@ -240,5 +241,6 @@ int main(int argc, char *argv[])
}
start_filter(desthost);
TALLOC_FREE(frame);
return 0;
}

View File

@ -521,6 +521,7 @@ int main(int argc, const char **argv)
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 @@ int main(int argc, const char **argv)
}
clean_exit();
TALLOC_FREE(frame);
return 0;
}

View File

@ -550,7 +550,9 @@ static int process_nonroot(int local_flags)
**********************************************************/
int main(int argc, char **argv)
{
TALLOC_CTX *frame = talloc_stackframe();
int local_flags = 0;
int ret;
AllowDebugChange = False;
@ -587,5 +589,7 @@ int main(int argc, char **argv)
return process_root(local_flags);
}
return process_nonroot(local_flags);
ret = process_nonroot(local_flags);
TALLOC_FREE(frame);
return ret;
}

View File

@ -249,6 +249,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
****************************************************************************/
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 @@ static BOOL print_tree(struct user_auth_info *user_info)
/* 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;
}