summaryrefslogtreecommitdiff
path: root/source3
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
commitc5d8fd3772706a469484df8a16abf10547d1c7a4 (patch)
tree6637e9e9eb0b80648bfed19b4c3e391968a7aacd /source3
parent30ee281cae04b70e0f2568ab164bbafd55772edc (diff)
downloadsamba-c5d8fd3772706a469484df8a16abf10547d1c7a4.tar.gz
samba-c5d8fd3772706a469484df8a16abf10547d1c7a4.tar.bz2
samba-c5d8fd3772706a469484df8a16abf10547d1c7a4.zip
r25002: Refactor out code duplication created by the previous
unification of r24998. Michael (This used to be commit 6026d132537f2fb2a963fa54377a926fa99eeb35)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_smbconf.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/source3/registry/reg_smbconf.c b/source3/registry/reg_smbconf.c
index f2a8b6ee8b..91afa09ed1 100644
--- a/source3/registry/reg_smbconf.c
+++ b/source3/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);
}