git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
094c103
)
s4:lib/registry/ldb.c - fix memory handling in "ldb_open_key"
author
Matthias Dieter Wallnöfer
<mdw@samba.org>
Mon, 28 Jun 2010 19:17:37 +0000
(21:17 +0200)
committer
Matthias Dieter Wallnöfer
<mdw@samba.org>
Mon, 28 Jun 2010 21:02:56 +0000
(23:02 +0200)
source4/lib/registry/ldb.c
patch
|
blob
|
history
diff --git
a/source4/lib/registry/ldb.c
b/source4/lib/registry/ldb.c
index b2b1e745f344c150d0762b72a0e9892c9758c33f..f0a1c431c50ef6d9978a6d8b4acd24efac96b3e8 100644
(file)
--- 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 = ®_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;