summaryrefslogtreecommitdiffstats
path: root/source4/lib/registry/ldb.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-28 21:17:37 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-28 23:02:56 +0200
commitba01b216e23ddae9961f7120792969fc2fe075b1 (patch)
tree44c5e409a52c3a2f66e8081164b6e06c23bb3df6 /source4/lib/registry/ldb.c
parent094c1034d2fb11e746261ff5b5048cd52fce2938 (diff)
downloadsamba-ba01b216e23ddae9961f7120792969fc2fe075b1.tar.gz
samba-ba01b216e23ddae9961f7120792969fc2fe075b1.tar.xz
samba-ba01b216e23ddae9961f7120792969fc2fe075b1.zip
s4:lib/registry/ldb.c - fix memory handling in "ldb_open_key"
Diffstat (limited to 'source4/lib/registry/ldb.c')
-rw-r--r--source4/lib/registry/ldb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index b2b1e745f3..f0a1c431c5 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -522,12 +522,15 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct hive_key *h,
}
newkd = talloc_zero(mem_ctx, struct ldb_key_data);
+ W_ERROR_HAVE_NO_MEMORY(newkd);
newkd->key.ops = &reg_backend_ldb;
newkd->ldb = talloc_reference(newkd, kd->ldb);
- newkd->dn = ldb_dn_copy(mem_ctx, res->msgs[0]->dn);
+ newkd->dn = ldb_dn_copy(newkd, res->msgs[0]->dn);
newkd->classname = talloc_steal(newkd,
ldb_msg_find_attr_as_string(res->msgs[0], "classname", NULL);
+ talloc_free(res);
+
*key = (struct hive_key *)newkd;
return WERR_OK;