summaryrefslogtreecommitdiff
path: root/source4/lib/registry/common
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-10 22:57:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:30 -0500
commitf0eff2525b8df834765a7162007bc8b4565e9a58 (patch)
treed0903882670ba66ec968a0bc2dce80d97fe6e6b1 /source4/lib/registry/common
parentd792ee488372c7259567d12b141cf449c0bdb6a8 (diff)
downloadsamba-f0eff2525b8df834765a7162007bc8b4565e9a58.tar.gz
samba-f0eff2525b8df834765a7162007bc8b4565e9a58.tar.bz2
samba-f0eff2525b8df834765a7162007bc8b4565e9a58.zip
r4140: Get rid of close_hive (replace it with talloc destructors).
(This used to be commit bcbfce7b0119538bab06801c97aa9c7d4bf3a6c6)
Diffstat (limited to 'source4/lib/registry/common')
-rw-r--r--source4/lib/registry/common/reg_interface.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index 2382e4aa43..cd0b54e2dc 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -149,7 +149,8 @@ WERROR reg_get_hive(struct registry_context *ctx, uint32_t hkey, struct registry
/* Open a registry file/host/etc */
WERROR reg_open_hive(struct registry_context *parent_ctx, const char *backend, const char *location, const char *credentials, struct registry_key **root)
{
- struct registry_hive *ret;
+ struct registry_hive *rethive;
+ struct registry_key *retkey;
struct reg_init_function_entry *entry;
WERROR werr;
@@ -164,28 +165,30 @@ WERROR reg_open_hive(struct registry_context *parent_ctx, const char *backend, c
return WERR_NOT_SUPPORTED;
}
- ret = talloc_p(parent_ctx, struct registry_hive);
- ret->location = location?talloc_strdup(ret, location):NULL;
- ret->functions = entry->hive_functions;
- ret->backend_data = NULL;
- ret->reg_ctx = parent_ctx;
+ rethive = talloc_p(parent_ctx, struct registry_hive);
+ rethive->location = location?talloc_strdup(rethive, location):NULL;
+ rethive->functions = entry->hive_functions;
+ rethive->backend_data = NULL;
+ rethive->reg_ctx = parent_ctx;
- werr = entry->hive_functions->open_hive(ret, &ret->root);
+ werr = entry->hive_functions->open_hive(rethive, &retkey);
+
+ rethive->root = retkey;
if(!W_ERROR_IS_OK(werr)) {
return werr;
}
- if(!ret->root) {
+ if(!retkey) {
DEBUG(0, ("Backend %s didn't provide root key!\n", backend));
return WERR_GENERAL_FAILURE;
}
- ret->root->hive = ret;
- ret->root->name = NULL;
- ret->root->path = talloc_strdup(ret, "");
+ retkey->hive = rethive;
+ retkey->name = NULL;
+ retkey->path = talloc_strdup(retkey, "");
- *root = ret->root;
+ *root = retkey;
return WERR_OK;
}