summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-27 07:08:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:15 -0500
commit759da3b915e2006d4c87b5ace47f399accd9ce91 (patch)
tree6bcaf9d4c0e38ef5e975c041d442c4437aa61e5a /source4/lib/registry
parent1e42cacf6a8643bd633f631c212d71760852abbc (diff)
downloadsamba-759da3b915e2006d4c87b5ace47f399accd9ce91.tar.gz
samba-759da3b915e2006d4c87b5ace47f399accd9ce91.tar.bz2
samba-759da3b915e2006d4c87b5ace47f399accd9ce91.zip
r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/common/reg_interface.c18
-rw-r--r--source4/lib/registry/common/reg_util.c6
-rw-r--r--source4/lib/registry/reg_backend_dir.c8
-rw-r--r--source4/lib/registry/reg_backend_gconf.c14
-rw-r--r--source4/lib/registry/reg_backend_ldb.c30
-rw-r--r--source4/lib/registry/reg_backend_nt4.c6
-rw-r--r--source4/lib/registry/reg_backend_rpc.c24
-rw-r--r--source4/lib/registry/reg_backend_w95.c12
-rw-r--r--source4/lib/registry/reg_samba.c4
-rw-r--r--source4/lib/registry/tools/regdiff.c8
-rw-r--r--source4/lib/registry/tools/regshell.c8
-rw-r--r--source4/lib/registry/tools/regtree.c4
12 files changed, 71 insertions, 71 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index 442b34bc13..8385cef108 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -44,7 +44,7 @@ NTSTATUS registry_register(const void *_hive_ops)
return NT_STATUS_OBJECT_NAME_COLLISION;
}
- entry = talloc_p(talloc_autofree_context(), struct reg_init_function_entry);
+ entry = talloc(talloc_autofree_context(), struct reg_init_function_entry);
entry->hive_functions = hive_ops;
DLIST_ADD(backends, entry);
@@ -93,8 +93,8 @@ static struct {
int reg_list_predefs(TALLOC_CTX *mem_ctx, char ***predefs, uint32_t **hkeys)
{
int i;
- *predefs = talloc_array_p(mem_ctx, char *, ARRAY_SIZE(predef_names));
- *hkeys = talloc_array_p(mem_ctx, uint32_t, ARRAY_SIZE(predef_names));
+ *predefs = talloc_array(mem_ctx, char *, ARRAY_SIZE(predef_names));
+ *hkeys = talloc_array(mem_ctx, uint32_t, ARRAY_SIZE(predef_names));
for (i = 0; predef_names[i].name; i++) {
(*predefs)[i] = talloc_strdup(mem_ctx, predef_names[i].name);
@@ -129,7 +129,7 @@ WERROR reg_get_predefined_key_by_name(struct registry_context *ctx, const char *
WERROR reg_close (struct registry_context *ctx)
{
- talloc_destroy(ctx);
+ talloc_free(ctx);
return WERR_OK;
}
@@ -165,7 +165,7 @@ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *backend, const char *lo
return WERR_NOT_SUPPORTED;
}
- rethive = talloc_p(parent_ctx, struct registry_hive);
+ rethive = talloc(parent_ctx, struct registry_hive);
rethive->location = location?talloc_strdup(rethive, location):NULL;
rethive->functions = entry->hive_functions;
rethive->backend_data = NULL;
@@ -277,7 +277,7 @@ WERROR reg_key_num_subkeys(struct registry_key *key, int *count)
TALLOC_CTX *mem_ctx = talloc_init("num_subkeys");
for(i = 0; W_ERROR_IS_OK(error = reg_key_get_subkey_by_index(mem_ctx, key, i, &dest)); i++);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
*count = i;
if(W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) error = WERR_OK;
@@ -303,7 +303,7 @@ WERROR reg_key_num_values(struct registry_key *key, int *count)
TALLOC_CTX *mem_ctx = talloc_init("num_subkeys");
for(i = 0; W_ERROR_IS_OK(error = key->hive->functions->get_value_by_index(mem_ctx, key, i, &dest)); i++);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
*count = i;
if(W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) error = WERR_OK;
@@ -490,7 +490,7 @@ WERROR reg_key_subkeysizes(struct registry_key *key, uint32 *max_subkeylen, uint
i++;
} while (W_ERROR_IS_OK(error));
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return WERR_OK;
}
@@ -517,7 +517,7 @@ WERROR reg_key_valuesizes(struct registry_key *key, uint32 *max_valnamelen, uint
i++;
} while (W_ERROR_IS_OK(error));
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return WERR_OK;
}
diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c
index ef46dd6174..b11b24151e 100644
--- a/source4/lib/registry/common/reg_util.c
+++ b/source4/lib/registry/common/reg_util.c
@@ -99,7 +99,7 @@ char *reg_val_description(TALLOC_CTX *mem_ctx, struct registry_value *val)
BOOL reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, const char *data_str, struct registry_value **value)
{
int i;
- *value = talloc_p(mem_ctx, struct registry_value);
+ *value = talloc(mem_ctx, struct registry_value);
(*value)->data_type = -1;
/* Find the correct type */
@@ -123,7 +123,7 @@ BOOL reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, const char *da
break;
case REG_DWORD:
(*value)->data_len = sizeof(uint32);
- (*value)->data_blk = talloc_p(mem_ctx, uint32);
+ (*value)->data_blk = talloc(mem_ctx, uint32);
*((uint32 *)(*value)->data_blk) = strtol(data_str, NULL, 0);
break;
@@ -264,7 +264,7 @@ WERROR reg_key_del_abs(struct registry_context *ctx, const char *path)
error = reg_key_del(parent, n);
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return error;
}
diff --git a/source4/lib/registry/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir.c
index 4af219facb..bac0f43c20 100644
--- a/source4/lib/registry/reg_backend_dir.c
+++ b/source4/lib/registry/reg_backend_dir.c
@@ -41,7 +41,7 @@ static WERROR reg_dir_del_key(struct registry_key *k, const char *name)
if (rmdir(child) == 0) ret = WERR_OK; else ret = WERR_GENERAL_FAILURE;
- talloc_destroy(child);
+ talloc_free(child);
return ret;
}
@@ -67,7 +67,7 @@ static WERROR reg_dir_open_key(TALLOC_CTX *mem_ctx, struct registry_key *p, cons
return WERR_BADFILE;
}
closedir(d);
- ret = talloc_p(mem_ctx, struct registry_key);
+ ret = talloc(mem_ctx, struct registry_key);
ret->hive = p->hive;
ret->path = fullpath;
ret->backend_data = unixpath;
@@ -98,7 +98,7 @@ static WERROR reg_dir_key_by_index(TALLOC_CTX *mem_ctx, struct registry_key *k,
if(S_ISDIR(stbuf.st_mode)) {
if(i == idx) {
- (*key) = talloc_p(mem_ctx, struct registry_key);
+ (*key) = talloc(mem_ctx, struct registry_key);
(*key)->name = e->d_name;
(*key)->path = NULL;
(*key)->backend_data = talloc_strdup(mem_ctx, thispath);
@@ -122,7 +122,7 @@ static WERROR reg_dir_open(struct registry_hive *h, struct registry_key **key)
{
if(!h->location) return WERR_INVALID_PARAM;
- *key = talloc_p(h, struct registry_key);
+ *key = talloc(h, struct registry_key);
(*key)->backend_data = talloc_strdup(*key, h->location);
return WERR_OK;
}
diff --git a/source4/lib/registry/reg_backend_gconf.c b/source4/lib/registry/reg_backend_gconf.c
index 47d8c760ab..a912a42e55 100644
--- a/source4/lib/registry/reg_backend_gconf.c
+++ b/source4/lib/registry/reg_backend_gconf.c
@@ -35,7 +35,7 @@ static WERROR reg_open_gconf_hive(struct registry_hive *h, struct registry_key *
h->backend_data = (void *)gconf_client_get_default();
if(!h->backend_data) return WERR_FOOBAR;
- *k = talloc_p(h, struct registry_key);
+ *k = talloc(h, struct registry_key);
(*k)->name = talloc_strdup(*k, "");
(*k)->path = talloc_strdup(*k, "");
(*k)->backend_data = talloc_strdup(*k, "/");
@@ -57,7 +57,7 @@ static WERROR gconf_open_key (TALLOC_CTX *mem_ctx, struct registry_key *h, const
return WERR_DEST_NOT_FOUND;
}
- ret = talloc_p(mem_ctx, struct registry_key);
+ ret = talloc(mem_ctx, struct registry_key);
ret->backend_data = fullpath;
*key = ret;
@@ -83,7 +83,7 @@ static WERROR gconf_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p,
entry = cur->data;
value = gconf_entry_get_value(entry);
- newval = talloc_p(mem_ctx, struct registry_value);
+ newval = talloc(mem_ctx, struct registry_value);
newval->name = talloc_strdup(mem_ctx, strrchr(gconf_entry_get_key(entry), '/')+1);
if(value) {
switch(value->type) {
@@ -99,20 +99,20 @@ static WERROR gconf_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p,
case GCONF_VALUE_INT:
newval->data_type = REG_DWORD;
- newval->data_blk = talloc_p(mem_ctx, long);
+ newval->data_blk = talloc(mem_ctx, long);
*((long *)newval->data_blk) = gconf_value_get_int(value);
newval->data_len = sizeof(long);
break;
case GCONF_VALUE_FLOAT:
- newval->data_blk = talloc_p(mem_ctx, double);
+ newval->data_blk = talloc(mem_ctx, double);
newval->data_type = REG_BINARY;
*((double *)newval->data_blk) = gconf_value_get_float(value);
newval->data_len = sizeof(double);
break;
case GCONF_VALUE_BOOL:
- newval->data_blk = talloc_p(mem_ctx, BOOL);
+ newval->data_blk = talloc(mem_ctx, BOOL);
newval->data_type = REG_BINARY;
*((BOOL *)newval->data_blk) = gconf_value_get_bool(value);
newval->data_len = sizeof(BOOL);
@@ -142,7 +142,7 @@ static WERROR gconf_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p
if(!cur) return WERR_NO_MORE_ITEMS;
- *sub = talloc_p(mem_ctx, struct registry_key);
+ *sub = talloc(mem_ctx, struct registry_key);
(*sub)->name = talloc_strdup(mem_ctx, strrchr((char *)cur->data, '/')+1);
(*sub)->backend_data = talloc_strdup(mem_ctx, cur->data);
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index e0d7b6e2cb..930ea9642e 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -52,7 +52,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, struct ldb_message *msg, c
case REG_DWORD_LE:
*len = 4;
- *data = talloc_p(mem_ctx, uint32);
+ *data = talloc(mem_ctx, uint32);
SIVAL(*data, 0, strtol(val->data, NULL, 0));
break;
@@ -66,7 +66,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, struct ldb_message *msg, c
static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, TALLOC_CTX *mem_ctx, const char *name, uint32 type, void *data, int len)
{
struct ldb_val val;
- struct ldb_message *msg = talloc_zero_p(mem_ctx, struct ldb_message);
+ struct ldb_message *msg = talloc_zero(mem_ctx, struct ldb_message);
char *type_s;
ldb_msg_add_string(ctx, msg, "value", talloc_strdup(mem_ctx, name));
@@ -165,10 +165,10 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k,
el = ldb_msg_find_element(kd->subkeys[idx], "key");
- *subkey = talloc_p(mem_ctx, struct registry_key);
+ *subkey = talloc(mem_ctx, struct registry_key);
talloc_set_destructor(*subkey, reg_close_ldb_key);
(*subkey)->name = talloc_strdup(mem_ctx, el->values[0].data);
- (*subkey)->backend_data = newkd = talloc_zero_p(*subkey, struct ldb_key_data);
+ (*subkey)->backend_data = newkd = talloc_zero(*subkey, struct ldb_key_data);
newkd->dn = talloc_strdup(mem_ctx, kd->subkeys[idx]->dn);
return WERR_OK;
@@ -191,7 +191,7 @@ static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, i
if(idx >= kd->value_count) return WERR_NO_MORE_ITEMS;
- *value = talloc_p(mem_ctx, struct registry_value);
+ *value = talloc(mem_ctx, struct registry_value);
reg_ldb_unpack_value(mem_ctx, kd->values[idx], &(*value)->name, &(*value)->data_type, &(*value)->data_blk, &(*value)->data_len);
@@ -217,10 +217,10 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const ch
return WERR_FOOBAR;
}
- *key = talloc_p(mem_ctx, struct registry_key);
+ *key = talloc(mem_ctx, struct registry_key);
talloc_set_destructor(*key, reg_close_ldb_key);
(*key)->name = talloc_strdup(mem_ctx, strrchr(name, '\\')?strchr(name, '\\'):name);
- (*key)->backend_data = newkd = talloc_zero_p(*key, struct ldb_key_data);
+ (*key)->backend_data = newkd = talloc_zero(*key, struct ldb_key_data);
newkd->dn = talloc_strdup(mem_ctx, msg[0]->dn);
ldb_search_free(c, msg);
@@ -247,11 +247,11 @@ static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
ldb_set_debug_stderr(c);
hive->backend_data = c;
- *k = talloc_zero_p(hive, struct registry_key);
+ *k = talloc_zero(hive, struct registry_key);
talloc_set_destructor (*k, reg_close_ldb_key);
talloc_set_destructor (hive, ldb_close_hive);
(*k)->name = talloc_strdup(*k, "");
- (*k)->backend_data = kd = talloc_zero_p(*k, struct ldb_key_data);
+ (*k)->backend_data = kd = talloc_zero(*k, struct ldb_key_data);
kd->dn = talloc_strdup(*k, "hive=");
@@ -277,10 +277,10 @@ static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, struct registry_key *parent, con
return WERR_FOOBAR;
}
- *newkey = talloc_zero_p(mem_ctx, struct registry_key);
+ *newkey = talloc_zero(mem_ctx, struct registry_key);
(*newkey)->name = talloc_strdup(mem_ctx, name);
- (*newkey)->backend_data = newkd = talloc_zero_p(*newkey, struct ldb_key_data);
+ (*newkey)->backend_data = newkd = talloc_zero(*newkey, struct ldb_key_data);
newkd->dn = talloc_steal(newkd, msg->dn);
return WERR_OK;
@@ -294,7 +294,7 @@ static WERROR ldb_del_key (struct registry_key *key, const char *child)
ret = ldb_delete(key->hive->backend_data, childdn);
- talloc_destroy(childdn);
+ talloc_free(childdn);
if (ret < 0) {
DEBUG(1, ("ldb_del_key: %s\n", ldb_errstring(key->hive->backend_data)));
@@ -312,7 +312,7 @@ static WERROR ldb_del_value (struct registry_key *key, const char *child)
ret = ldb_delete(key->hive->backend_data, childdn);
- talloc_destroy(childdn);
+ talloc_free(childdn);
if (ret < 0) {
DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(key->hive->backend_data)));
@@ -339,12 +339,12 @@ static WERROR ldb_set_value (struct registry_key *parent, const char *name, uint
ret = ldb_modify(ctx, msg);
if (ret < 0) {
DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(parent->hive->backend_data)));
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return WERR_FOOBAR;
}
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return WERR_OK;
}
diff --git a/source4/lib/registry/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4.c
index cd3be85a23..88033a8a8b 100644
--- a/source4/lib/registry/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4.c
@@ -902,7 +902,7 @@ static WERROR vk_to_val(TALLOC_CTX *mem_ctx, struct registry_key *parent, VK_HDR
dat_len = IVAL(&vk_hdr->dat_len,0); /* If top bit, offset contains data */
dat_off = IVAL(&vk_hdr->dat_off,0);
- tmp = talloc_p(mem_ctx, struct registry_value);
+ tmp = talloc(mem_ctx, struct registry_value);
tmp->data_type = dat_type;
if (flag & FLAG_HAS_NAME) {
@@ -1070,7 +1070,7 @@ static WERROR nk_to_key(TALLOC_CTX *mem_ctx, struct registry_hive *h, NK_HDR *nk
return WERR_GENERAL_FAILURE;
}
- tmp = talloc_p(mem_ctx, struct registry_key);
+ tmp = talloc(mem_ctx, struct registry_key);
tmp->name = talloc_strdup(mem_ctx, key_name);
tmp->backend_data = nk_hdr;
@@ -1574,7 +1574,7 @@ static WERROR nt_open_hive (struct registry_hive *h, struct registry_key **key)
uint_t regf_id, hbin_id;
HBIN_HDR *hbin_hdr;
- regf = (REGF *)talloc_p(h, REGF);
+ regf = (REGF *)talloc(h, REGF);
memset(regf, 0, sizeof(REGF));
regf->owner_sid_str = NULL; /* FIXME: Fill in */
h->backend_data = regf;
diff --git a/source4/lib/registry/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc.c
index c5ed9b2c88..d2809f644a 100644
--- a/source4/lib/registry/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc.c
@@ -109,14 +109,14 @@ static WERROR rpc_get_predefined_key (struct registry_context *ctx, uint32 hkey_
return WERR_NO_MORE_ITEMS;
}
- h = talloc_p(ctx, struct registry_hive);
+ h = talloc(ctx, struct registry_hive);
h->functions = &reg_backend_rpc;
h->location = NULL;
h->backend_data = ctx->backend_data;
- (*k) = h->root = talloc_p(h, struct registry_key);
+ (*k) = h->root = talloc(h, struct registry_key);
(*k)->hive = h;
- (*k)->backend_data = mykeydata = talloc_p(*k, struct rpc_key_data);
+ (*k)->backend_data = mykeydata = talloc(*k, struct rpc_key_data);
mykeydata->num_values = -1;
mykeydata->num_subkeys = -1;
return known_hives[n].open((struct dcerpc_pipe *)ctx->backend_data, *k, &(mykeydata->pol));
@@ -135,7 +135,7 @@ static WERROR rpc_key_put_rpc_data(TALLOC_CTX *mem_ctx, struct registry_key *k)
struct winreg_OpenKey r;
struct rpc_key_data *mykeydata;
- k->backend_data = mykeydata = talloc_p(mem_ctx, struct rpc_key_data);
+ k->backend_data = mykeydata = talloc(mem_ctx, struct rpc_key_data);
mykeydata->num_values = -1;
mykeydata->num_subkeys = -1;
@@ -159,10 +159,10 @@ static WERROR rpc_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const ch
struct rpc_key_data *mykeydata;
struct winreg_OpenKey r;
- *key = talloc_p(mem_ctx, struct registry_key);
+ *key = talloc(mem_ctx, struct registry_key);
(*key)->name = talloc_strdup(mem_ctx, name);
- (*key)->backend_data = mykeydata = talloc_p(mem_ctx, struct rpc_key_data);
+ (*key)->backend_data = mykeydata = talloc(mem_ctx, struct rpc_key_data);
mykeydata->num_values = -1;
mykeydata->num_subkeys = -1;
@@ -217,7 +217,7 @@ static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *p
if(NT_STATUS_IS_OK(status) &&
W_ERROR_IS_OK(r.out.result) && r.out.length) {
- *value = talloc_p(mem_ctx, struct registry_value);
+ *value = talloc(mem_ctx, struct registry_value);
(*value)->name = talloc_strdup(mem_ctx, r.out.name_out.name);
(*value)->data_type = type;
(*value)->data_len = *r.out.length;
@@ -266,7 +266,7 @@ static WERROR rpc_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, cons
init_winreg_String(&r.in.class, NULL);
r.in.handle = parent->backend_data;
- r.out.handle = talloc_p(mem_ctx, struct policy_handle);
+ r.out.handle = talloc(mem_ctx, struct policy_handle);
r.in.options = 0;
r.in.access_mask = access_mask;
r.in.sec_desc = NULL;
@@ -279,7 +279,7 @@ static WERROR rpc_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, cons
}
if (W_ERROR_IS_OK(r.out.result)) {
- *key = talloc_p(mem_ctx, struct registry_key);
+ *key = talloc(mem_ctx, struct registry_key);
(*key)->name = talloc_strdup(*key, name);
(*key)->backend_data = r.out.handle;
}
@@ -298,7 +298,7 @@ static WERROR rpc_query_key(struct registry_key *k)
r.in.handle = &mykeydata->pol;
status = dcerpc_winreg_QueryInfoKey((struct dcerpc_pipe *)(k->hive->backend_data), mem_ctx, &r);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("QueryInfoKey failed - %s\n", nt_errstr(status)));
@@ -327,7 +327,7 @@ static WERROR rpc_del_key(struct registry_key *parent, const char *name)
status = dcerpc_winreg_DeleteKey((struct dcerpc_pipe *)parent->hive->backend_data, mem_ctx, &r);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return r.out.result;
}
@@ -374,7 +374,7 @@ WERROR reg_open_remote (struct registry_context **ctx, const char *user, const c
NTSTATUS status;
struct dcerpc_pipe *p;
- *ctx = talloc_p(NULL, struct registry_context);
+ *ctx = talloc(NULL, struct registry_context);
/* Default to local smbd if no connection is specified */
if (!location) {
diff --git a/source4/lib/registry/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95.c
index 957039dea3..ff02f4d12b 100644
--- a/source4/lib/registry/reg_backend_w95.c
+++ b/source4/lib/registry/reg_backend_w95.c
@@ -187,7 +187,7 @@ static WERROR w95_open_reg (struct registry_hive *h, struct registry_key **root)
DWORD i;
DWORD offset;
- creg = talloc_p(h, CREG);
+ creg = talloc(h, CREG);
memset(creg, 0, sizeof(CREG));
h->backend_data = creg;
@@ -234,7 +234,7 @@ static WERROR w95_open_reg (struct registry_hive *h, struct registry_key **root)
}
#endif
- creg->rgdb_keys = talloc_array_p(h, RGDB_KEY **, creg->creg_hdr->num_rgdb);
+ creg->rgdb_keys = talloc_array(h, RGDB_KEY **, creg->creg_hdr->num_rgdb);
offset = 0;
DEBUG(3, ("Reading %d rgdb entries\n", creg->creg_hdr->num_rgdb));
@@ -250,7 +250,7 @@ static WERROR w95_open_reg (struct registry_hive *h, struct registry_key **root)
}
- creg->rgdb_keys[i] = talloc_array_p(h, RGDB_KEY *, rgdb_hdr->max_id+1);
+ creg->rgdb_keys[i] = talloc_array(h, RGDB_KEY *, rgdb_hdr->max_id+1);
memset(creg->rgdb_keys[i], 0, sizeof(RGDB_KEY *) * (rgdb_hdr->max_id+1));
parse_rgdb_block(creg, rgdb_hdr);
@@ -259,7 +259,7 @@ static WERROR w95_open_reg (struct registry_hive *h, struct registry_key **root)
}
/* First element in rgkn should be root key */
- *root = talloc_p(h, struct registry_key);
+ *root = talloc(h, struct registry_key);
(*root)->name = NULL;
(*root)->backend_data = LOCN_RGKN(creg, sizeof(RGKN_HDR));
@@ -288,7 +288,7 @@ static WERROR w95_get_subkey_by_index (TALLOC_CTX *mem_ctx, struct registry_key
DEBUG(0, ("Can't find %d,%d in RGDB table!\n", child->id.rgdb, child->id.id));
return WERR_FOOBAR;
}
- *key = talloc_p(mem_ctx, struct registry_key);
+ *key = talloc(mem_ctx, struct registry_key);
(*key)->backend_data = child;
(*key)->name = talloc_strndup(mem_ctx, (char *)rgdb_key + sizeof(RGDB_KEY), rgdb_key->name_len);
return WERR_OK;
@@ -331,7 +331,7 @@ static WERROR w95_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, i
offset+=sizeof(RGDB_VALUE) + curval->name_len + curval->data_len;
}
- *value = talloc_p(mem_ctx, struct registry_value);
+ *value = talloc(mem_ctx, struct registry_value);
(*value)->name = talloc_strndup(mem_ctx, (char *)curval+sizeof(RGDB_VALUE), curval->name_len);
(*value)->data_len = curval->data_len;
diff --git a/source4/lib/registry/reg_samba.c b/source4/lib/registry/reg_samba.c
index 62973a14ab..a81b9e5a42 100644
--- a/source4/lib/registry/reg_samba.c
+++ b/source4/lib/registry/reg_samba.c
@@ -59,14 +59,14 @@ static WERROR reg_samba_get_predef (struct registry_context *ctx, uint32 hkey, s
error = reg_open_hive(ctx, backend, location, NULL, k);
- talloc_destroy(backend);
+ talloc_free(backend);
return error;
}
WERROR reg_open_local (struct registry_context **ctx)
{
- *ctx = talloc_p(NULL, struct registry_context);
+ *ctx = talloc(NULL, struct registry_context);
(*ctx)->get_predefined_key = reg_samba_get_predef;
return WERR_OK;
diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c
index 8d88cafe59..ceae3a427e 100644
--- a/source4/lib/registry/tools/regdiff.c
+++ b/source4/lib/registry/tools/regdiff.c
@@ -41,7 +41,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey,
}
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while getting subkey by index: %d\n", W_ERROR_V(error1)));
@@ -60,7 +60,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey,
writediff(t2, t1, out);
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while getting subkey by index: %d\n", W_ERROR_V(error1)));
@@ -82,7 +82,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey,
}
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while getting value by index: %d\n", W_ERROR_V(error1)));
@@ -101,7 +101,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey,
}
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while getting value by index: %d\n", W_ERROR_V(error1)));
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 1dd0e04561..ac7dbca49b 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -329,14 +329,14 @@ static char **reg_complete_key(const char *text, int start, int end)
break;
} else {
printf("Error creating completion list: %s\n", win_errstr(status));
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return NULL;
}
}
if (j == 1) { /* No matches at all */
SAFE_FREE(matches);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return NULL;
}
@@ -345,7 +345,7 @@ static char **reg_complete_key(const char *text, int start, int end)
} else {
asprintf(&matches[0], "%s%s", base_n, talloc_strndup(mem_ctx, matches[1], samelen));
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
matches[j] = NULL;
return matches;
@@ -435,7 +435,7 @@ static char **reg_completion(const char *text, int start, int end)
if(new)curkey = new;
}
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return 0;
}
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index a6beb2b484..f061f33bd3 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -47,7 +47,7 @@ static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
for(i = 0; W_ERROR_IS_OK(error = reg_key_get_subkey_by_index(mem_ctx, p, i, &subkey)); i++) {
print_tree(l+1, subkey, fullpath, novals);
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while fetching subkeys for '%s': %s\n", p->path, win_errstr(error)));
@@ -62,7 +62,7 @@ static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
desc = reg_val_description(mem_ctx, value);
printf("%s\n", desc);
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
DEBUG(0, ("Error occured while fetching values for '%s': %s\n", p->path, win_errstr(error)));