[SCM] Samba Shared Repository - branch master updated -
39f7ec3f7468d8b044f4d1d403aa60a306451d20
Michael Adam
obnox at samba.org
Sat Sep 27 20:27:35 GMT 2008
The branch, master has been updated
via 39f7ec3f7468d8b044f4d1d403aa60a306451d20 (commit)
via 628ee436a1104655616ea1b25f920a2d2d24099a (commit)
from 6bfd63e0104d3f8d57e20492e27fc280695bcbb1 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 39f7ec3f7468d8b044f4d1d403aa60a306451d20
Author: Michael Adam <obnox at samba.org>
Date: Sat Sep 27 22:10:44 2008 +0200
[s3]testparm: give testparm one common exit point and call gfree_loadparm().
Michael
commit 628ee436a1104655616ea1b25f920a2d2d24099a
Author: Michael Adam <obnox at samba.org>
Date: Sat Sep 27 22:10:05 2008 +0200
[s3]testparm: free the popt context when it is no longer used.
Michael
-----------------------------------------------------------------------
Summary of changes:
source3/utils/testparm.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 527db2d..4370d49 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -329,9 +329,12 @@ 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);
+ ret = 1;
+ goto done;
}
if (new_local_machine) {
@@ -346,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");
@@ -393,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)
@@ -407,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());
@@ -428,7 +434,10 @@ rameter is ignored when using CUPS libraries.\n",
}
}
}
+
+done:
TALLOC_FREE(frame);
- return(ret);
+ gfree_loadparm();
+ return ret;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list