summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-24 20:11:09 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-28 23:02:56 +0200
commit2fb3d8a6cc94bd74974a2cc11996a2032774b08c (patch)
tree868eedc65d302a451818a1171b6ed766a59a9a9a /source4/lib/registry
parent3935502c67edd436134bac0c663ed3d5b593ec32 (diff)
downloadsamba-2fb3d8a6cc94bd74974a2cc11996a2032774b08c.tar.gz
samba-2fb3d8a6cc94bd74974a2cc11996a2032774b08c.tar.bz2
samba-2fb3d8a6cc94bd74974a2cc11996a2032774b08c.zip
s4:lib/registry/ldb.c - remove really useless "local_ctx"
"mem_ctx" should fit for these few local allocations.
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 9295486ec9..20a892c151 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -275,19 +275,15 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx,
const struct hive_key *from,
const char *path, const char *add)
{
- TALLOC_CTX *local_ctx;
struct ldb_dn *ret;
char *mypath = talloc_strdup(mem_ctx, path);
char *begin;
struct ldb_key_data *kd = talloc_get_type(from, struct ldb_key_data);
struct ldb_context *ldb = kd->ldb;
- local_ctx = talloc_new(mem_ctx);
-
ret = ldb_dn_new(mem_ctx, ldb, add);
if (!ldb_dn_validate(ret)) {
talloc_free(ret);
- talloc_free(local_ctx);
return NULL;
}
@@ -301,10 +297,10 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx,
if (keyname[0] != '\0') {
if (!ldb_dn_add_base_fmt(ret, "key=%s",
- reg_ldb_escape(local_ctx,
+ reg_ldb_escape(mem_ctx,
keyname)))
{
- talloc_free(local_ctx);
+ talloc_free(ret);
return NULL;
}
}
@@ -318,8 +314,6 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx,
ldb_dn_add_base(ret, kd->dn);
- talloc_free(local_ctx);
-
return ret;
}