From 628ee436a1104655616ea1b25f920a2d2d24099a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 27 Sep 2008 22:10:05 +0200 Subject: [s3]testparm: free the popt context when it is no longer used. Michael --- source3/utils/testparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/utils/testparm.c') diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index 527db2d805..ccbb2dd391 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -329,6 +329,8 @@ rameter is ignored when using CUPS libraries.\n", cname = poptGetArg(pc); caddr = poptGetArg(pc); + poptFreeContext(pc); + if ( cname && ! caddr ) { printf ( "ERROR: You must specify both a machine name and an IP address.\n" ); return(1); -- cgit From 39f7ec3f7468d8b044f4d1d403aa60a306451d20 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 27 Sep 2008 22:10:44 +0200 Subject: [s3]testparm: give testparm one common exit point and call gfree_loadparm(). Michael --- source3/utils/testparm.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/utils/testparm.c') diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index ccbb2dd391..4370d49523 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -333,7 +333,8 @@ rameter is ignored when using CUPS libraries.\n", if ( cname && ! caddr ) { printf ( "ERROR: You must specify both a machine name and an IP address.\n" ); - return(1); + ret = 1; + goto done; } if (new_local_machine) { @@ -348,7 +349,8 @@ rameter is ignored when using CUPS libraries.\n", if (!lp_load_with_registry_shares(config_file,False,True,False,True)) { fprintf(stderr,"Error loading services.\n"); - return(1); + ret = 1; + goto done; } fprintf(stderr,"Loaded services file OK.\n"); @@ -395,13 +397,15 @@ rameter is ignored when using CUPS libraries.\n", (s=lp_servicenumber(section_name)) == -1) { fprintf(stderr,"Unknown section %s\n", section_name); - return(1); + ret = 1; + goto done; } if (parameter_name) { if (!dump_a_parameter( s, parameter_name, stdout, isGlobal)) { fprintf(stderr,"Parameter %s unknown for section %s\n", parameter_name, section_name); - return(1); + ret = 1; + goto done; } } else { if (isGlobal == True) @@ -409,7 +413,7 @@ rameter is ignored when using CUPS libraries.\n", else lp_dump_one(stdout, show_defaults, s); } - return(ret); + goto done; } lp_dump(stdout, show_defaults, lp_numservices()); @@ -430,7 +434,10 @@ rameter is ignored when using CUPS libraries.\n", } } } + +done: TALLOC_FREE(frame); - return(ret); + gfree_loadparm(); + return ret; } -- cgit