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;
}
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;
}
}
ldb_dn_add_base(ret, kd->dn);
- talloc_free(local_ctx);
-
return ret;
}