summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-13 18:39:54 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-14 18:46:20 +0100
commit3c6792bc76323f821bc9e44ea3d724ce39e9081f (patch)
tree28636995439c740b42eedcc5bc2c7a555e5b0699 /source4/lib/registry
parent727fb8578261de8eed335ce5210d86ea556ce6d3 (diff)
downloadsamba-3c6792bc76323f821bc9e44ea3d724ce39e9081f.tar.gz
samba-3c6792bc76323f821bc9e44ea3d724ce39e9081f.tar.bz2
samba-3c6792bc76323f821bc9e44ea3d724ce39e9081f.zip
s4:registry - ldb.c - Move the "val" structure
Move it into the REG_SZ/REG_EXPAND_SZ case block since it's used only there. Plus convert it from static into dynamic talloc'ed.
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 0213c54a53..f226cbf450 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -98,7 +98,6 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
const char *name,
uint32_t type, DATA_BLOB data)
{
- struct ldb_val val;
struct ldb_message *msg = talloc_zero(mem_ctx, struct ldb_message);
char *type_s;
@@ -109,11 +108,14 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
case REG_EXPAND_SZ:
if ((data.length > 0) && (data.data != NULL)
&& (data.data[0] != '\0')) {
+ struct ldb_val *val;
+
+ val = talloc_zero(msg, struct ldb_val);
convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8,
(void *)data.data,
data.length,
- (void **)&val.data, &val.length, false);
- ldb_msg_add_value(msg, "data", &val, NULL);
+ (void **)&val->data, &val->length, false);
+ ldb_msg_add_value(msg, "data", val, NULL);
} else {
ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
}