summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/testparm.c19
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;
}