From c5d8fd3772706a469484df8a16abf10547d1c7a4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 7 Sep 2007 15:45:39 +0000 Subject: r25002: Refactor out code duplication created by the previous unification of r24998. Michael (This used to be commit 6026d132537f2fb2a963fa54377a926fa99eeb35) --- source3/registry/reg_smbconf.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'source3') 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); } -- cgit