summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-18 15:06:53 +1300
committerJeremy Allison <jra@samba.org>2014-05-07 19:49:14 +0200
commit294dd73d18e7cd881d77d765c36af5bf880043bd (patch)
tree2e2d44af2ede943f1eb6949f4dc9e22ecbd86abd
parentdcb3f2150e1b983c4d85623ff98b103e074d1331 (diff)
downloadsamba-294dd73d18e7cd881d77d765c36af5bf880043bd.tar.gz
samba-294dd73d18e7cd881d77d765c36af5bf880043bd.tar.xz
samba-294dd73d18e7cd881d77d765c36af5bf880043bd.zip
param: remove unnecessary temporary service in handle copy
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/param/loadparm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 8006167fe5..278d176bd8 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2796,23 +2796,19 @@ static bool handle_copy(struct loadparm_context *unused, int snum, const char *p
{
bool bRetval;
int iTemp;
- struct loadparm_service serviceTemp;
-
- string_set(ptr, pszParmValue);
-
- init_service(&serviceTemp);
bRetval = false;
DEBUG(3, ("Copying service from service %s\n", pszParmValue));
- if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) {
+ if ((iTemp = getservicebyname(pszParmValue, NULL)) >= 0) {
if (iTemp == iServiceIndex) {
DEBUG(0, ("Can't copy service %s - unable to copy self!\n", pszParmValue));
} else {
copy_service(ServicePtrs[iServiceIndex],
- &serviceTemp,
+ ServicePtrs[iTemp],
ServicePtrs[iServiceIndex]->copymap);
+ string_set(ptr, pszParmValue);
bRetval = true;
}
} else {
@@ -2820,7 +2816,6 @@ static bool handle_copy(struct loadparm_context *unused, int snum, const char *p
bRetval = false;
}
- free_service(&serviceTemp);
return (bRetval);
}