diff options
author | Michael Adam <obnox@samba.org> | 2008-09-27 22:10:44 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-09-27 22:28:25 +0200 |
commit | 39f7ec3f7468d8b044f4d1d403aa60a306451d20 (patch) | |
tree | d6f926f05b5a7a9ee77399018f6c6803e7ce1a89 | |
parent | 628ee436a1104655616ea1b25f920a2d2d24099a (diff) | |
download | samba-39f7ec3f7468d8b044f4d1d403aa60a306451d20.tar.gz samba-39f7ec3f7468d8b044f4d1d403aa60a306451d20.tar.bz2 samba-39f7ec3f7468d8b044f4d1d403aa60a306451d20.zip |
[s3]testparm: give testparm one common exit point and call gfree_loadparm().
Michael
-rw-r--r-- | source3/utils/testparm.c | 19 |
1 files changed, 13 insertions, 6 deletions
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; } |