summaryrefslogtreecommitdiff
path: root/source4/lib/registry/common/reg_interface.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-10 23:13:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:30 -0500
commit0bde7a2944fded24af8a9b19a3bb42015bbdd6bb (patch)
tree6ce059fe9ad4b8e895624d7dc9ec3332e51f7121 /source4/lib/registry/common/reg_interface.c
parentf0eff2525b8df834765a7162007bc8b4565e9a58 (diff)
downloadsamba-0bde7a2944fded24af8a9b19a3bb42015bbdd6bb.tar.gz
samba-0bde7a2944fded24af8a9b19a3bb42015bbdd6bb.tar.bz2
samba-0bde7a2944fded24af8a9b19a3bb42015bbdd6bb.zip
r4141: Fix crash bug in ldb backend
(This used to be commit 5f64a60374486b9fc3d75786c3035a9017dd4d33)
Diffstat (limited to 'source4/lib/registry/common/reg_interface.c')
-rw-r--r--source4/lib/registry/common/reg_interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index cd0b54e2dc..b7211d92a4 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -150,7 +150,7 @@ WERROR reg_get_hive(struct registry_context *ctx, uint32_t hkey, struct registry
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 *rethive;
- struct registry_key *retkey;
+ struct registry_key *retkey = NULL;
struct reg_init_function_entry *entry;
WERROR werr;
@@ -173,17 +173,17 @@ WERROR reg_open_hive(struct registry_context *parent_ctx, const char *backend, c
werr = entry->hive_functions->open_hive(rethive, &retkey);
- rethive->root = retkey;
-
if(!W_ERROR_IS_OK(werr)) {
return werr;
}
-
+
if(!retkey) {
DEBUG(0, ("Backend %s didn't provide root key!\n", backend));
return WERR_GENERAL_FAILURE;
}
+ rethive->root = retkey;
+
retkey->hive = rethive;
retkey->name = NULL;
retkey->path = talloc_strdup(retkey, "");