summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-09-07 15:45:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:32 -0500
commit6026d132537f2fb2a963fa54377a926fa99eeb35 (patch)
treef3bdfaea4a8609124746d6ffd17a26ba253c67ea /source
parentdab9ffe602eaca478a73f3b882f543629ce3001e (diff)
downloadsamba-6026d132537f2fb2a963fa54377a926fa99eeb35.tar.gz
samba-6026d132537f2fb2a963fa54377a926fa99eeb35.tar.xz
samba-6026d132537f2fb2a963fa54377a926fa99eeb35.zip
r25002: Refactor out code duplication created by the previous
unification of r24998. Michael
Diffstat (limited to 'source')
-rw-r--r--source/registry/reg_smbconf.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/source/registry/reg_smbconf.c b/source/registry/reg_smbconf.c
index f2a8b6ee8bd..91afa09ed1f 100644
--- a/source/registry/reg_smbconf.c
+++ b/source/registry/reg_smbconf.c
@@ -168,7 +168,7 @@ static BOOL smbconf_store_values( const char *key, REGVAL_CTR *val )
DEBUG(10, ("adding canonicalized parameter to "
"container.\n"));
- theval = regval_compose(mem_ctx, canon_valname,
+ theval = regval_compose(val, canon_valname,
value->type,
(char *)value_data.data,
value_data.length);
@@ -178,15 +178,6 @@ static BOOL smbconf_store_values( const char *key, REGVAL_CTR *val )
TALLOC_FREE(mem_ctx);
return False;
}
- res = regval_ctr_copyvalue(new_val_ctr, theval);
- if (res == 0) {
- DEBUG(10, ("error calling regval_ctr_addvalue. "
- "(no memory?)\n"));
- TALLOC_FREE(mem_ctx);
- return False;
- }
- DEBUG(10, ("parameter added. container now has %d "
- "values.\n", res));
TALLOC_FREE(mem_ctx);
} else {
@@ -194,15 +185,15 @@ static BOOL smbconf_store_values( const char *key, REGVAL_CTR *val )
"copying it to new container...\n",
(lp_parameter_is_valid(valname)?
"valid":"unknown")));
- res = regval_ctr_copyvalue(new_val_ctr, theval);
- if (res == 0) {
- DEBUG(10, ("error calling regval_ctr_copyvalue."
- " (no memory?)\n"));
- return False;
- }
- DEBUG(10, ("parameter copied. container now has %d "
- "values.\n", res));
}
+ res = regval_ctr_copyvalue(new_val_ctr, theval);
+ if (res == 0) {
+ DEBUG(10, ("error calling regval_ctr_copyvalue."
+ " (no memory?)\n"));
+ return False;
+ }
+ DEBUG(10, ("parameter copied. container now has %d "
+ "values.\n", res));
}
return regdb_ops.store_values(key, new_val_ctr);
}