summaryrefslogtreecommitdiffstats
path: root/lib/param/loadparm.c
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-18 13:26:22 +1300
committerJeremy Allison <jra@samba.org>2014-05-07 19:49:15 +0200
commitbbcd8d64dd25a9fe83850a85242cb7259aae0099 (patch)
tree3a8f3a8308fd68d262711e0cadb5d7c4940c98a7 /lib/param/loadparm.c
parentc34a063a6d6b6c57c108cf0f0490a318ec6e1bd3 (diff)
downloadsamba-bbcd8d64dd25a9fe83850a85242cb7259aae0099.tar.gz
samba-bbcd8d64dd25a9fe83850a85242cb7259aae0099.tar.xz
samba-bbcd8d64dd25a9fe83850a85242cb7259aae0099.zip
lib/param: remove duplicated copy service in lpcfg_add_a_service
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/param/loadparm.c')
-rw-r--r--lib/param/loadparm.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 8a6e300a8ac..e7ebdc3bb01 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -558,18 +558,6 @@ bool lpcfg_parm_bool(struct loadparm_context *lp_ctx,
/**
- * Initialise a service to the defaults.
- */
-
-static struct loadparm_service *init_service(TALLOC_CTX *mem_ctx, struct loadparm_service *sDefault)
-{
- struct loadparm_service *pservice =
- talloc_zero(mem_ctx, struct loadparm_service);
- copy_service(pservice, sDefault, NULL);
- return pservice;
-}
-
-/**
* Set a string value, deallocating any existing space, and allocing the space
* for the string
*/
@@ -621,7 +609,6 @@ struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
const char *name)
{
int i;
- struct loadparm_service tservice;
int num_to_alloc = lp_ctx->iNumServices + 1;
struct parmlist_entry *data, *pdata;
@@ -629,8 +616,6 @@ struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
pservice = lp_ctx->sDefault;
}
- tservice = *pservice;
-
/* it might already exist */
if (name) {
struct loadparm_service *service = getservicebyname(lp_ctx,
@@ -671,12 +656,12 @@ struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
lp_ctx->iNumServices++;
}
- lp_ctx->services[i] = init_service(lp_ctx->services, lp_ctx->sDefault);
+ lp_ctx->services[i] = talloc_zero(lp_ctx->services, struct loadparm_service);
if (lp_ctx->services[i] == NULL) {
DEBUG(0,("lpcfg_add_service: out of memory!\n"));
return NULL;
}
- copy_service(lp_ctx->services[i], &tservice, NULL);
+ copy_service(lp_ctx->services[i], pservice, NULL);
if (name != NULL)
lpcfg_string_set(lp_ctx->services[i], &lp_ctx->services[i]->szService, name);
return lp_ctx->services[i];