1
0
mirror of https://github.com/samba-team/samba.git synced 2025-04-27 06:50:24 +03:00

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 commit is contained in:
Andrew Tridgell 2005-01-27 07:08:20 +00:00 committed by Gerald (Jerry) Carter
parent 1d1a9c11ee
commit ec32b22ed5
200 changed files with 751 additions and 752 deletions

View File

@ -1780,7 +1780,7 @@ static int cmd_allinfo(const char **cmd_ptr)
d_printf("\tcluster_shift %ld\n", (long)finfo.compression_info.out.cluster_shift);
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
done:
return ret;
@ -1816,7 +1816,7 @@ static int cmd_eainfo(const char **cmd_ptr)
if (!NT_STATUS_IS_OK(status)) {
d_printf("RAW_FILEINFO_ALL_EAS - %s\n", nt_errstr(status));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return 1;
}
@ -1833,7 +1833,7 @@ static int cmd_eainfo(const char **cmd_ptr)
finfo.all_eas.out.eas[i].value.length);
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return ret;
}
@ -1888,7 +1888,7 @@ static int cmd_acl(const char **cmd_ptr)
NDR_PRINT_DEBUG(security_descriptor, query.query_secdesc.out.sd);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
done:
return ret;
@ -2016,7 +2016,7 @@ static int cmd_addprivileges(const char **cmd_ptr)
ZERO_STRUCT(rights);
while (next_token(cmd_ptr,buf,NULL,sizeof(buf))) {
rights.names = talloc_realloc_p(mem_ctx, rights.names,
rights.names = talloc_realloc(mem_ctx, rights.names,
struct lsa_String, rights.count+1);
rights.names[rights.count].string = talloc_strdup(mem_ctx, buf);
rights.count++;
@ -2066,7 +2066,7 @@ static int cmd_delprivileges(const char **cmd_ptr)
ZERO_STRUCT(rights);
while (next_token(cmd_ptr,buf,NULL,sizeof(buf))) {
rights.names = talloc_realloc_p(mem_ctx, rights.names,
rights.names = talloc_realloc(mem_ctx, rights.names,
struct lsa_String, rights.count+1);
rights.names[rights.count].string = talloc_strdup(mem_ctx, buf);
rights.count++;
@ -2568,7 +2568,7 @@ static BOOL browse_host(const char *query_host)
if (!NT_STATUS_IS_OK(status)) {
d_printf("Failed to connect to %s - %s\n",
binding, nt_errstr(status));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return False;
}
talloc_steal(mem_ctx, p);
@ -2595,7 +2595,7 @@ static BOOL browse_host(const char *query_host)
}
} while (NT_STATUS_IS_OK(status) && W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
d_printf("Failed NetShareEnumAll %s - %s/%s\n",
@ -3283,7 +3283,7 @@ static void remember_query_host(const char *arg,
DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) );
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if ((p=strchr_m(query_host,'#'))) {
*p = 0;

View File

@ -258,7 +258,7 @@ int samdb_search_string_multiple(struct ldb_wrap *sam_ctx,
}
}
*strs = talloc_array_p(mem_ctx, const char *, count+1);
*strs = talloc_array(mem_ctx, const char *, count+1);
if (! *strs) {
samdb_search_free(sam_ctx, mem_ctx, res);
return -1;
@ -467,7 +467,7 @@ uint_t samdb_result_hashes(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
return 0;
}
*hashes = talloc_array_p(mem_ctx, struct samr_Password, count);
*hashes = talloc_array(mem_ctx, struct samr_Password, count);
if (! *hashes) {
return 0;
}
@ -488,7 +488,7 @@ NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
struct samr_Password *lmPwdHash, *ntPwdHash;
if (unicodePwd) {
if (nt_pwd) {
ntPwdHash = talloc_p(mem_ctx, struct samr_Password);
ntPwdHash = talloc(mem_ctx, struct samr_Password);
if (!ntPwdHash) {
return NT_STATUS_NO_MEMORY;
}
@ -500,7 +500,7 @@ NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
if (lm_pwd) {
BOOL lm_hash_ok;
lmPwdHash = talloc_p(mem_ctx, struct samr_Password);
lmPwdHash = talloc(mem_ctx, struct samr_Password);
if (!lmPwdHash) {
return NT_STATUS_NO_MEMORY;
}
@ -551,7 +551,7 @@ struct samr_LogonHours samdb_result_logon_hours(TALLOC_CTX *mem_ctx, struct ldb_
const int units_per_week = 168;
const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
ZERO_STRUCT(hours);
hours.bits = talloc_array_p(mem_ctx, uint8, units_per_week);
hours.bits = talloc_array(mem_ctx, uint8, units_per_week);
if (!hours.bits) {
return hours;
}

View File

@ -319,7 +319,7 @@ const char *gtk_rpc_binding_dialog_get_host(GtkRpcBindingDialog *d)
struct dcerpc_binding *gtk_rpc_binding_dialog_get_binding(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx)
{
struct dcerpc_binding *binding = talloc_p(mem_ctx, struct dcerpc_binding);
struct dcerpc_binding *binding = talloc(mem_ctx, struct dcerpc_binding);
ZERO_STRUCT(binding->object);

View File

@ -142,7 +142,7 @@ GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe)
status = dcerpc_samr_Connect(sam_pipe, mem_ctx, &cr);
if (!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(NULL, status);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return GTK_WIDGET(d);
}
@ -168,11 +168,11 @@ GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe)
status = dcerpc_samr_Close(sam_pipe, mem_ctx, &dr);
if (!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(NULL, status);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return GTK_WIDGET ( d );
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return GTK_WIDGET ( d );
}

View File

@ -118,7 +118,7 @@ static void refresh_eps(void)
struct policy_handle handle;
TALLOC_CTX *mem_ctx = talloc_init("dump");
talloc_destroy(eps_ctx);
talloc_free(eps_ctx);
ZERO_STRUCT(handle);
@ -152,10 +152,10 @@ static void refresh_eps(void)
if (!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}
static void on_refresh_clicked (GtkButton *btn, gpointer user_data)

View File

@ -990,7 +990,7 @@ static GtkWidget* create_savefilewin (void)
gtk_main ();
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return 0;
}

View File

@ -70,7 +70,7 @@ void update_joblist(void)
-1);
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
gtk_widget_set_sensitive(tasks, TRUE);
}
@ -115,12 +115,12 @@ on_connect_activate (GtkMenuItem *menuitem,
gtk_show_ntstatus(mainwin, status);
at_pipe = NULL;
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
update_joblist();
}
@ -164,12 +164,12 @@ on_new_activate (GtkMenuItem *menuitem,
status = dcerpc_atsvc_JobAdd(at_pipe, mem_ctx, &r);
if(!NT_STATUS_IS_OK(status)) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
gtk_show_ntstatus(mainwin, status);
return;
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
gtk_widget_destroy(d);
d = gtk_message_dialog_new (GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Job Id: %d", r.out.job_id);
@ -200,7 +200,7 @@ on_delete_activate (GtkMenuItem *menuitem,
mem_ctx = talloc_init("del_job");
status = dcerpc_atsvc_JobDel(at_pipe, mem_ctx, &r);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if(!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
return;

View File

@ -58,12 +58,12 @@ void update_userlist(void)
status = dcerpc_samr_EnumDomainUsers(sam_pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
if (!r.out.sam || r.out.sam->count == 0) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
@ -75,7 +75,7 @@ void update_userlist(void)
// ret = False;
// }
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}
void
@ -139,7 +139,7 @@ static void connect_sam(void)
gtk_show_ntstatus(mainwin, status);
sam_pipe = NULL;
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
@ -152,7 +152,7 @@ static void connect_sam(void)
gtk_show_ntstatus(mainwin, status);
sam_pipe = NULL;
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return;
}
@ -160,7 +160,7 @@ static void connect_sam(void)
gtk_widget_set_sensitive (mnu_disconnect, TRUE);
gtk_window_set_title (GTK_WINDOW (mainwin), talloc_asprintf(mem_ctx, "User Manager - Connected to %s", gtk_rpc_binding_dialog_get_host(d)));
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}

View File

@ -110,7 +110,6 @@ extern int errno;
/* Lists, trees, caching, database... */
#include "xfile.h"
#define TALLOC_DEPRECATED 1
#include "lib/talloc/talloc.h"
#include "nt_status.h"
#include "structs.h"

View File

@ -133,7 +133,7 @@ BOOL lang_tdb_init(const char *lang)
if (stat(msg_path, &st) != 0) {
/* the msg file isn't available */
free(msg_path);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return False;
}
@ -145,14 +145,14 @@ BOOL lang_tdb_init(const char *lang)
tdb = tdb_open(path, 0, TDB_DEFAULT, O_RDONLY, 0);
free(path);
free(msg_path);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (!tdb) return False;
current_lang = strdup(lang);
return True;
}
free(path);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
loadtime = tdb_fetch_int32(tdb, "/LOADTIME/");

View File

@ -27,7 +27,7 @@ struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, enum ldap_re
{
struct ldapsrv_reply *reply;
reply = talloc_p(call, struct ldapsrv_reply);
reply = talloc(call, struct ldapsrv_reply);
if (!reply) {
return NULL;
}

View File

@ -322,7 +322,7 @@ static NTSTATUS hacked_Search(struct ldapsrv_partition *partition, struct ldapsr
}
if (r->num_attributes >= 1) {
attrs = talloc_array_p(samdb, const char *, r->num_attributes+1);
attrs = talloc_array(samdb, const char *, r->num_attributes+1);
NT_STATUS_HAVE_NO_MEMORY(attrs);
for (j=0; j < r->num_attributes; j++) {
@ -354,7 +354,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter));
goto queue_reply;
}
ent->num_attributes = res[0]->num_elements;
ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
ent->attributes[j].name = talloc_steal(ent->attributes, res[0]->elements[j].name);
@ -362,7 +362,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter));
ent->attributes[j].values = NULL;
ent->attributes[j].num_values = res[0]->elements[j].num_values;
if (ent->attributes[j].num_values == 1) {
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
status = convert_values(ent_r,
@ -373,7 +373,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter));
return status;
}
} else {
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
for (y=0; y < ent->attributes[j].num_values; y++) {
@ -402,7 +402,7 @@ queue_reply:
goto queue_reply2;
}
ent->num_attributes = res[i]->num_elements;
ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name);
@ -412,7 +412,7 @@ queue_reply:
continue;
}
ent->attributes[j].num_values = res[i]->elements[j].num_values;
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
if (ent->attributes[j].num_values == 1) {
@ -520,7 +520,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
}
if (r->num_attributes >= 1) {
attrs = talloc_array_p(samdb, const char *, r->num_attributes+1);
attrs = talloc_array(samdb, const char *, r->num_attributes+1);
NT_STATUS_HAVE_NO_MEMORY(attrs);
for (i=0; i < r->num_attributes; i++) {
@ -552,7 +552,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
goto queue_reply;
}
ent->num_attributes = res[i]->num_elements;
ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name);
@ -562,7 +562,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
continue;
}
ent->attributes[j].num_values = res[i]->elements[j].num_values;
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
for (y=0; y < ent->attributes[j].num_values; y++) {
@ -635,7 +635,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
DEBUG(10, ("hldb_add: dn: [%s]\n", dn->dn));
msg = talloc_p(local_ctx, struct ldb_message);
msg = talloc(local_ctx, struct ldb_message);
NT_STATUS_HAVE_NO_MEMORY(msg);
msg->dn = dn->dn;
@ -645,7 +645,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
if (r->num_attributes > 0) {
msg->num_elements = r->num_attributes;
msg->elements = talloc_array_p(msg, struct ldb_message_element, msg->num_elements);
msg->elements = talloc_array(msg, struct ldb_message_element, msg->num_elements);
NT_STATUS_HAVE_NO_MEMORY(msg->elements);
for (i=0; i < msg->num_elements; i++) {
@ -656,7 +656,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
if (r->attributes[i].num_values > 0) {
msg->elements[i].num_values = r->attributes[i].num_values;
msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values);
msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
for (j=0; j < msg->elements[i].num_values; j++) {
@ -787,7 +787,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
DEBUG(10, ("hldb_modify: dn: [%s]\n", dn->dn));
msg = talloc_p(local_ctx, struct ldb_message);
msg = talloc(local_ctx, struct ldb_message);
NT_STATUS_HAVE_NO_MEMORY(msg);
msg->dn = dn->dn;
@ -797,7 +797,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
if (r->num_mods > 0) {
msg->num_elements = r->num_mods;
msg->elements = talloc_array_p(msg, struct ldb_message_element, r->num_mods);
msg->elements = talloc_array(msg, struct ldb_message_element, r->num_mods);
NT_STATUS_HAVE_NO_MEMORY(msg->elements);
for (i=0; i < msg->num_elements; i++) {
@ -823,7 +823,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
msg->elements[i].num_values = r->mods[i].attrib.num_values;
if (msg->elements[i].num_values > 0) {
msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values);
msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
for (j=0; j < msg->elements[i].num_values; j++) {

View File

@ -80,7 +80,7 @@ static void ldap_parse_attributetypedescription(struct ldap_schema *schema, DATA
{
char *desc;
desc = talloc_array_p(schema, char, data->lenght + 1);
desc = talloc_array(schema, char, data->lenght + 1);
memcpy(desc, data->data, data->lenght);
desc[data->lenght] = '\0';
@ -90,7 +90,7 @@ static void ldap_parse_objectclassdescription(struct ldap_schema *schema, DATA_B
{
char *desc;
desc = talloc_array_p(schema, char, data->lenght + 1);
desc = talloc_array(schema, char, data->lenght + 1);
memcpy(desc, data->data, data->lenght);
desc[data->lenght] = '\0';
@ -112,7 +112,7 @@ static struct ldap_schema *ldap_get_schema(void *mem_ctx, struct ldap_schema *sc
local_schema = schema;
if (local_schema == NULL) {
local_schema = talloc_p(mem_ctx, struct ldap_schema);
local_schema = talloc(mem_ctx, struct ldap_schema);
ALLOC_CHECK(local_schema);
}
@ -156,10 +156,10 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn)
char *p, *start, *separator, *src, *dest, *dn_copy, *dn_end;
int i, size, orig_len;
dn = talloc_p(mem_ctx, struct ldap_dn);
dn = talloc(mem_ctx, struct ldap_dn);
dn->comp_num = 0;
dn->components = talloc_array_p(dn, struct dn_component *, 1);
component = talloc_p(dn, struct dn_component);
dn->components = talloc_array(dn, struct dn_component *, 1);
component = talloc(dn, struct dn_component);
component->attr_num = 0;
orig_len = strlen(orig_dn);
@ -171,8 +171,8 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn)
dn_copy = p = talloc_strdup(mem_ctx, orig_dn);
dn_end = dn_copy + orig_len + 1;
do {
component->attributes = talloc_array_p(component, struct dn_attribute *, 1);
attribute = talloc_p(component, struct dn_attribute);
component->attributes = talloc_array(component, struct dn_attribute *, 1);
attribute = talloc(component, struct dn_attribute);
/* skip "spaces" */
while (*p == ' ' || *p == '\n') {
@ -255,10 +255,10 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn)
component->attr_num++;
if (*separator == '+') { /* expect other attributes in this component */
component->attributes = talloc_realloc_p(component, component->attributes, struct dn_attribute *, component->attr_num + 1);
component->attributes = talloc_realloc(component, component->attributes, struct dn_attribute *, component->attr_num + 1);
/* allocate new attribute structure */
attribute = talloc_p(component, struct dn_attribute);
attribute = talloc(component, struct dn_attribute);
/* skip spaces past the separator */
p = separator + strspn(p, " \n");
@ -290,8 +290,8 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn)
dn->comp_num++;
if (*separator == ',' || *separator == ';') {
dn->components = talloc_realloc_p(dn, dn->components, struct dn_component *, dn->comp_num + 1);
component = talloc_p(dn, struct dn_component);
dn->components = talloc_realloc(dn, dn->components, struct dn_component *, dn->comp_num + 1);
component = talloc(dn, struct dn_component);
component->attr_num = 0;
}
p = separator + 1;

View File

@ -84,7 +84,7 @@ static void *rootdse_db_connect(TALLOC_CTX *mem_ctx)
return talloc_reference(mem_ctx, ctx);
}
ctx = talloc_p(mem_ctx, struct rootdse_db_context);
ctx = talloc(mem_ctx, struct rootdse_db_context);
if (ctx == NULL) {
errno = ENOMEM;
return NULL;
@ -124,7 +124,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs)
if (strcasecmp(attrs->name, "currentTime") == 0)
{
int num_currentTime = 1;
DATA_BLOB *currentTime = talloc_array_p(mem_ctx, DATA_BLOB, num_currentTime);
DATA_BLOB *currentTime = talloc_array(mem_ctx, DATA_BLOB, num_currentTime);
char *str = ldap_timestring(mem_ctx, time(NULL));
NT_STATUS_HAVE_NO_MEMORY(str);
currentTime[0].data = (uint8_t *)str;
@ -205,7 +205,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs)
if (strcasecmp(attrs->name, "supportedLDAPVersion") == 0)
{
int num_supportedLDAPVersion = 1;
DATA_BLOB *supportedLDAPVersion = talloc_array_p(mem_ctx, DATA_BLOB, num_supportedLDAPVersion);
DATA_BLOB *supportedLDAPVersion = talloc_array(mem_ctx, DATA_BLOB, num_supportedLDAPVersion);
supportedLDAPVersion[0] = ATTR_BLOB_CONST("3");
ATTR_SINGLE_NOVAL(mem_ctx, attrs, supportedLDAPVersion, num_supportedLDAPVersion, "supportedLDAPVersion");
return NT_STATUS_OK;
@ -288,7 +288,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs)
*/
{
DATA_BLOB *x = talloc_array_p(mem_ctx, DATA_BLOB, 1);
DATA_BLOB *x = talloc_array(mem_ctx, DATA_BLOB, 1);
x[0] = ATTR_BLOB_CONST("0");
ATTR_SINGLE_NOVAL(mem_ctx, attrs, x, 1, attrs->name);
}
@ -321,7 +321,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps
NT_STATUS_HAVE_NO_MEMORY(rootdsedb);
if (r->num_attributes >= 1) {
attrs = talloc_array_p(rootdsedb, const char *, r->num_attributes+1);
attrs = talloc_array(rootdsedb, const char *, r->num_attributes+1);
NT_STATUS_HAVE_NO_MEMORY(attrs);
for (j=0; j < r->num_attributes; j++) {
@ -346,7 +346,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps
goto queue_reply;
}
ent->num_attributes = res[0]->num_elements;
ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
ent->attributes[j].name = talloc_steal(ent->attributes, res[0]->elements[j].name);
@ -360,7 +360,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps
return status;
}
} else {
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
for (y=0; y < ent->attributes[j].num_values; y++) {

View File

@ -65,16 +65,16 @@ static void ldapsrv_init(struct server_service *service)
DEBUG(10,("ldapsrv_init\n"));
ldap_service = talloc_p(service, struct ldapsrv_service);
ldap_service = talloc(service, struct ldapsrv_service);
if (!ldap_service) {
DEBUG(0,("talloc_p(service, struct ldapsrv_service) failed\n"));
DEBUG(0,("talloc(service, struct ldapsrv_service) failed\n"));
return;
}
ZERO_STRUCTP(ldap_service);
rootDSE_part = talloc_p(ldap_service, struct ldapsrv_partition);
rootDSE_part = talloc(ldap_service, struct ldapsrv_partition);
if (!rootDSE_part) {
DEBUG(0,("talloc_p(ldap_service, struct ldapsrv_partition) failed\n"));
DEBUG(0,("talloc(ldap_service, struct ldapsrv_partition) failed\n"));
return;
}
rootDSE_part->base_dn = ""; /* RootDSE */
@ -83,9 +83,9 @@ static void ldapsrv_init(struct server_service *service)
ldap_service->rootDSE = rootDSE_part;
DLIST_ADD_END(ldap_service->partitions, rootDSE_part, struct ldapsrv_partition *);
part = talloc_p(ldap_service, struct ldapsrv_partition);
part = talloc(ldap_service, struct ldapsrv_partition);
if (!ldap_service) {
DEBUG(0,("talloc_p(ldap_service, struct ldapsrv_partition) failed\n"));
DEBUG(0,("talloc(ldap_service, struct ldapsrv_partition) failed\n"));
return;
}
part->base_dn = "*"; /* default partition */
@ -467,7 +467,7 @@ static void ldapsrv_recv(struct server_connection *conn, struct timeval t,
return;
}
call = talloc_p(ldap_conn, struct ldapsrv_call);
call = talloc(ldap_conn, struct ldapsrv_call);
if (!call) {
ldapsrv_terminate_connection(ldap_conn, "no memory");
return;
@ -546,7 +546,7 @@ static void ldapsrv_accept(struct server_connection *conn)
DEBUG(10, ("ldapsrv_accept\n"));
ldap_conn = talloc_p(conn, struct ldapsrv_connection);
ldap_conn = talloc(conn, struct ldapsrv_connection);
if (ldap_conn == NULL)
return;

View File

@ -79,7 +79,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
}
if (r->num_attributes >= 1) {
attrs = talloc_array_p(samdb, const char *, r->num_attributes+1);
attrs = talloc_array(samdb, const char *, r->num_attributes+1);
NT_STATUS_HAVE_NO_MEMORY(attrs);
for (i=0; i < r->num_attributes; i++) {
@ -104,7 +104,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
goto queue_reply;
}
ent->num_attributes = res[i]->num_elements;
ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name);
@ -114,7 +114,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
continue;
}
ent->attributes[j].num_values = res[i]->elements[j].num_values;
ent->attributes[j].values = talloc_array_p(ent->attributes,
ent->attributes[j].values = talloc_array(ent->attributes,
DATA_BLOB, ent->attributes[j].num_values);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
for (y=0; y < ent->attributes[j].num_values; y++) {
@ -186,7 +186,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
DEBUG(10, ("sldb_add: dn: [%s]\n", dn->dn));
msg = talloc_p(local_ctx, struct ldb_message);
msg = talloc(local_ctx, struct ldb_message);
NT_STATUS_HAVE_NO_MEMORY(msg);
msg->dn = dn->dn;
@ -196,7 +196,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
if (r->num_attributes > 0) {
msg->num_elements = r->num_attributes;
msg->elements = talloc_array_p(msg, struct ldb_message_element, msg->num_elements);
msg->elements = talloc_array(msg, struct ldb_message_element, msg->num_elements);
NT_STATUS_HAVE_NO_MEMORY(msg->elements);
for (i=0; i < msg->num_elements; i++) {
@ -207,7 +207,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
if (r->attributes[i].num_values > 0) {
msg->elements[i].num_values = r->attributes[i].num_values;
msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values);
msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
for (j=0; j < msg->elements[i].num_values; j++) {
@ -337,7 +337,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
DEBUG(10, ("sldb_modify: dn: [%s]\n", dn->dn));
msg = talloc_p(local_ctx, struct ldb_message);
msg = talloc(local_ctx, struct ldb_message);
NT_STATUS_HAVE_NO_MEMORY(msg);
msg->dn = dn->dn;
@ -347,7 +347,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
if (r->num_mods > 0) {
msg->num_elements = r->num_mods;
msg->elements = talloc_array_p(msg, struct ldb_message_element, r->num_mods);
msg->elements = talloc_array(msg, struct ldb_message_element, r->num_mods);
NT_STATUS_HAVE_NO_MEMORY(msg->elements);
for (i=0; i < msg->num_elements; i++) {
@ -373,7 +373,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
msg->elements[i].num_values = r->mods[i].attrib.num_values;
if (msg->elements[i].num_values > 0) {
msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values);
msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
for (j=0; j < msg->elements[i].num_values; j++) {

View File

@ -150,7 +150,7 @@ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob)
int i;
char *hex_string;
hex_string = talloc_array_p(mem_ctx, char, (blob->length*2)+1);
hex_string = talloc_array(mem_ctx, char, (blob->length*2)+1);
if (!hex_string) {
return NULL;
}

View File

@ -80,7 +80,7 @@ struct ldb_wrap *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
}
}
w = talloc_p(mem_ctx, struct ldb_wrap);
w = talloc(mem_ctx, struct ldb_wrap);
if (w == NULL) {
return NULL;
}
@ -151,7 +151,7 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
}
}
w = talloc_p(mem_ctx, struct tdb_wrap);
w = talloc(mem_ctx, struct tdb_wrap);
if (w == NULL) {
return NULL;
}

View File

@ -71,10 +71,10 @@ static NTSTATUS dcom_connect_host(struct dcom_context *ctx, struct dcerpc_pipe *
DCERPC_IREMOTEACTIVATION_VERSION,
ctx->domain, ctx->user, ctx->password);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return status;
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
ZERO_STRUCT(bd);
bd.host = server;
@ -106,7 +106,7 @@ static NTSTATUS dcom_connect_host(struct dcom_context *ctx, struct dcerpc_pipe *
WERROR dcom_init(struct dcom_context **ctx, const char *domain, const char *user, const char *pass)
{
*ctx = talloc_p(NULL, struct dcom_context);
*ctx = talloc(NULL, struct dcom_context);
(*ctx)->oxids = NULL;
(*ctx)->domain = talloc_strdup(*ctx, domain);
(*ctx)->user = talloc_strdup(*ctx, user);
@ -128,7 +128,7 @@ static struct dcom_object_exporter *oxid_mapping_by_oxid (struct dcom_context *c
/* Add oxid mapping if we couldn't find one */
if (!m) {
m = talloc_zero_p(ctx, struct dcom_object_exporter);
m = talloc_zero(ctx, struct dcom_object_exporter);
m->oxid = oxid;
DLIST_ADD(ctx->oxids, m);
}
@ -169,7 +169,7 @@ static WERROR dcom_create_object_remote(struct dcom_context *ctx, struct GUID *c
r.in.protseq = protseq;
r.in.Interfaces = num_ifaces;
r.in.pIIDs = iid;
r.out.ifaces = talloc_array_p(ctx, struct pMInterfacePointer, num_ifaces);
r.out.ifaces = talloc_array(ctx, struct pMInterfacePointer, num_ifaces);
r.out.pdsaOxidBindings = &dualstring;
status = dcerpc_RemoteActivation(p, ctx, &r);
@ -186,7 +186,7 @@ static WERROR dcom_create_object_remote(struct dcom_context *ctx, struct GUID *c
return r.out.hr;
}
*ip = talloc_array_p(ctx, struct dcom_interface_p *, num_ifaces);
*ip = talloc_array(ctx, struct dcom_interface_p *, num_ifaces);
for (i = 0; i < num_ifaces; i++) {
results[i] = r.out.results[i];
(*ip)[i] = NULL;
@ -419,7 +419,7 @@ struct dcom_object *dcom_object_by_oid(struct dcom_object_exporter *ox, uint64_t
}
if (o == NULL) {
o = talloc_zero_p(ox, struct dcom_object);
o = talloc_zero(ox, struct dcom_object);
o->oid = oid;
DLIST_ADD(ox->objects, o);
}
@ -435,7 +435,7 @@ NTSTATUS dcom_OBJREF_from_ifacep(struct dcom_context *ctx, struct OBJREF *o, str
NTSTATUS dcom_ifacep_from_OBJREF(struct dcom_context *ctx, struct dcom_interface_p **_p, struct OBJREF *o)
{
struct dcom_interface_p *p = talloc_p(ctx, struct dcom_interface_p);
struct dcom_interface_p *p = talloc(ctx, struct dcom_interface_p);
p->ctx = ctx;
p->interface = dcom_interface_by_iid(&o->iid);
@ -502,7 +502,7 @@ NTSTATUS dcom_ifacep_from_OBJREF(struct dcom_context *ctx, struct dcom_interface
DEBUG(3, ("No binding data present yet, resolving OXID %llu\n", p->ox->oxid));
m = talloc_zero_p(p->ctx, struct dcom_oxid_mapping);
m = talloc_zero(p->ctx, struct dcom_oxid_mapping);
m->oxid = oxid;
i = 0;
@ -551,7 +551,7 @@ uint64_t dcom_get_current_oxid(void)
struct dcom_interface_p *dcom_new_local_ifacep(struct dcom_context *ctx, const struct GUID *iid, void *vtable, struct dcom_object *object)
{
struct dcom_interface_p *ip = talloc_p(ctx, struct dcom_interface_p);
struct dcom_interface_p *ip = talloc(ctx, struct dcom_interface_p);
const struct dcom_interface *iface = dcom_interface_by_iid(iid);
if (!iface) {

View File

@ -81,9 +81,9 @@ NTSTATUS dcom_register_interface(const void *_iface)
DEBUG(5, ("Adding DCOM interface %s\n", GUID_string(lcl_ctx, &iface->iid)));
talloc_destroy(lcl_ctx);
talloc_free(lcl_ctx);
l = talloc_zero_p(interfaces?interfaces:talloc_autofree_context(),
l = talloc_zero(interfaces?interfaces:talloc_autofree_context(),
struct interface_list);
l->interface = *iface;
@ -96,7 +96,7 @@ NTSTATUS dcom_register_interface(const void *_iface)
NTSTATUS dcom_register_class(const void *_class)
{
const struct dcom_class *class = _class;
struct class_list *l = talloc_zero_p(classes?classes:talloc_autofree_context(),
struct class_list *l = talloc_zero(classes?classes:talloc_autofree_context(),
struct class_list);
l->class = *class;

View File

@ -278,7 +278,7 @@ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const char *list
size_t i;
size_t list_len = strlen(list);
char *retstr = talloc_array_p(mem_ctx, char, len + 1);
char *retstr = talloc_array(mem_ctx, char, len + 1);
if (!retstr) return NULL;
generate_random_buffer((uint8_t *)retstr, len);

View File

@ -87,7 +87,7 @@ static void free_layer(struct idr_context *idp, struct idr_layer *p)
static int idr_pre_get(struct idr_context *idp)
{
while (idp->id_free_cnt < IDR_FREE_MAX) {
struct idr_layer *new = talloc_zero_p(idp, struct idr_layer);
struct idr_layer *new = talloc_zero(idp, struct idr_layer);
if(new == NULL)
return (0);
free_layer(idp, new);
@ -313,7 +313,7 @@ static int _idr_remove(struct idr_context *idp, int id)
*/
struct idr_context *idr_init(TALLOC_CTX *mem_ctx)
{
return talloc_zero_p(mem_ctx, struct idr_context);
return talloc_zero(mem_ctx, struct idr_context);
}
/*

View File

@ -199,7 +199,7 @@ static void messaging_listen_handler(struct event_context *ev, struct fd_event *
NTSTATUS status;
struct fd_event fde2;
rec = talloc_p(msg, struct messaging_rec);
rec = talloc(msg, struct messaging_rec);
if (rec == NULL) {
smb_panic("Unable to allocate messaging_rec");
}
@ -232,7 +232,7 @@ void messaging_register(struct messaging_context *msg, void *private,
{
struct dispatch_fn *d;
d = talloc_p(msg, struct dispatch_fn);
d = talloc(msg, struct dispatch_fn);
d->msg_type = msg_type;
d->private = private;
d->fn = fn;
@ -371,7 +371,7 @@ NTSTATUS messaging_send(struct messaging_context *msg, servid_t server, uint32_t
NTSTATUS status;
struct fd_event fde;
rec = talloc_p(msg, struct messaging_rec);
rec = talloc(msg, struct messaging_rec);
if (rec == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -460,7 +460,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, servid_t server_id
NTSTATUS status;
struct fd_event fde;
msg = talloc_p(mem_ctx, struct messaging_context);
msg = talloc(mem_ctx, struct messaging_context);
if (msg == NULL) {
return NULL;
}

View File

@ -198,7 +198,7 @@ int ms_fnmatch(const char *pattern, const char *string, enum protocol_types prot
if (pattern[i] == '*' || pattern[i] == '<') count++;
}
max_n = talloc_array_p(NULL, struct max_n, count);
max_n = talloc_array(NULL, struct max_n, count);
if (!max_n) {
return -1;
}

View File

@ -241,7 +241,7 @@ void load_interfaces(void)
}
exit:
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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)));

View File

@ -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;
}

View File

@ -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)));

View File

@ -202,7 +202,7 @@ static NTSTATUS ipv4_accept(struct socket_context *sock, struct socket_context *
* --metze
*/
(*new_sock) = talloc_p(NULL, struct socket_context);
(*new_sock) = talloc(NULL, struct socket_context);
if (!(*new_sock)) {
close(new_fd);
return NT_STATUS_NO_MEMORY;

View File

@ -179,7 +179,7 @@ static NTSTATUS ipv6_tcp_accept(struct socket_context *sock, struct socket_conte
* --metze
*/
(*new_sock) = talloc_p(NULL, struct socket_context);
(*new_sock) = talloc(NULL, struct socket_context);
if (!(*new_sock)) {
close(new_fd);
return NT_STATUS_NO_MEMORY;

View File

@ -162,7 +162,7 @@ static NTSTATUS unixdom_accept(struct socket_context *sock,
}
}
(*new_sock) = talloc_p(NULL, struct socket_context);
(*new_sock) = talloc(NULL, struct socket_context);
if (!(*new_sock)) {
close(new_fd);
return NT_STATUS_NO_MEMORY;

View File

@ -57,7 +57,7 @@ static int privileges_destructor(void *ptr)
void *root_privileges(void)
{
struct saved_state *s;
s = talloc_p(NULL, struct saved_state);
s = talloc(NULL, struct saved_state);
if (!s) return NULL;
s->uid = geteuid();
if (s->uid != 0) {

View File

@ -428,7 +428,7 @@ int open_udp_socket(const char *host, int port)
sock_out.sin_port = htons(port);
sock_out.sin_family = PF_INET;
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (connect(res,(struct sockaddr *)&sock_out,sizeof(sock_out))) {
close(res);

View File

@ -1057,7 +1057,7 @@ BOOL add_string_to_array(TALLOC_CTX *mem_ctx,
{
char *dup_str = talloc_strdup(mem_ctx, str);
*strings = talloc_realloc_p(mem_ctx,
*strings = talloc_realloc(mem_ctx,
*strings,
const char *, ((*num)+1));

View File

@ -41,7 +41,7 @@ static void load_case_tables(void)
}
upcase_table = map_file(lib_path(mem_ctx, "upcase.dat"), 0x20000);
lowcase_table = map_file(lib_path(mem_ctx, "lowcase.dat"), 0x20000);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (upcase_table == NULL) {
upcase_table = (void *)-1;
}

View File

@ -277,7 +277,7 @@ static struct berval *dup_berval(TALLOC_CTX *ctx, const struct berval *in_val)
if (!in_val) return NULL;
value = talloc_zero_p(ctx, struct berval);
value = talloc_zero(ctx, struct berval);
if (value == NULL)
return NULL;
if (in_val->bv_len == 0) return value;
@ -479,7 +479,7 @@ ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path,
ldap_controls_free(rcontrols);
done:
talloc_destroy(ctx);
talloc_free(ctx);
/* if/when we decide to utf8-encode attrs, take out this next line */
str_list_free(&search_attrs);
@ -641,7 +641,7 @@ ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
}
done:
talloc_destroy(ctx);
talloc_free(ctx);
/* if/when we decide to utf8-encode attrs, take out this next line */
str_list_free(&search_attrs);
return ADS_ERROR(rc);
@ -805,7 +805,7 @@ static ADS_STATUS ads_modlist_add(TALLOC_CTX *ctx, ADS_MODLIST *mods,
*mods = modlist;
}
if (!(modlist[curmod] = talloc_zero_p(ctx, LDAPMod)))
if (!(modlist[curmod] = talloc_zero(ctx, LDAPMod)))
return ADS_ERROR(LDAP_NO_MEMORY);
modlist[curmod]->mod_type = talloc_strdup(ctx, name);
if (mod_op & LDAP_MOD_BVALUES) {
@ -1088,7 +1088,7 @@ static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *hostname,
}
}
done:
talloc_destroy(ctx);
talloc_free(ctx);
return ret;
}
@ -1158,13 +1158,13 @@ static void dump_sd(const char *filed, struct berval **values)
/* parse secdesc */
if (!sec_io_desc("sd", &psd, &ps, 1)) {
prs_mem_free(&ps);
talloc_destroy(ctx);
talloc_free(ctx);
return;
}
if (psd) ads_disp_sd(psd);
prs_mem_free(&ps);
talloc_destroy(ctx);
talloc_free(ctx);
}
/*
@ -1292,7 +1292,7 @@ void ads_process_results(ADS_STRUCT *ads, void *res,
fn(NULL, NULL, data_area); /* completed an entry */
}
talloc_destroy(ctx);
talloc_free(ctx);
}
/**
@ -1514,7 +1514,7 @@ ADS_STATUS ads_set_machine_sd(ADS_STRUCT *ads, const char *hostname, char *dn)
ads_set_sd_error:
ads_msgfree(ads, res);
prs_mem_free(&ps_wire);
talloc_destroy(ctx);
talloc_free(ctx);
return ret;
}
@ -1593,7 +1593,7 @@ char **ads_pull_strings(ADS_STRUCT *ads,
*num_values = ldap_count_values(values);
ret = talloc_array_p(mem_ctx, char *, *num_values+1);
ret = talloc_array(mem_ctx, char *, *num_values+1);
if (!ret) {
ldap_value_free(values);
return NULL;
@ -1840,7 +1840,7 @@ int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
for (i=0; values[i]; i++)
/* nop */ ;
(*sids) = talloc_array_p(mem_ctx, DOM_SID, i);
(*sids) = talloc_array(mem_ctx, DOM_SID, i);
if (!(*sids)) {
ldap_value_free_len(values);
return 0;
@ -2000,7 +2000,7 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
p = strchr(value, ':');
if (!p) {
talloc_destroy(ctx);
talloc_free(ctx);
DEBUG(1, ("ads_server_info: returned ldap server name did not contain a ':' "
"so was deemed invalid\n"));
return ADS_ERROR(LDAP_DECODING_ERROR);
@ -2011,7 +2011,7 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
ads->config.ldap_server_name = strdup(p+1);
p = strchr(ads->config.ldap_server_name, '$');
if (!p || p[1] != '@') {
talloc_destroy(ctx);
talloc_free(ctx);
DEBUG(1, ("ads_server_info: returned ldap server name (%s) does not contain '$@'"
" so was deemed invalid\n", ads->config.ldap_server_name));
SAFE_FREE(ads->config.ldap_server_name);
@ -2037,7 +2037,7 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
DEBUG(4,("time offset is %d seconds\n", ads->auth.time_offset));
}
talloc_destroy(ctx);
talloc_free(ctx);
return ADS_SUCCESS;
}

View File

@ -162,7 +162,7 @@ static BOOL map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
};
if (num_vals) {
str_values = talloc_array_p(ctx, char *, num_vals + 1);
str_values = talloc_array(ctx, char *, num_vals + 1);
cur_str = value->data_p;
for (i=0; i < num_vals; i++) {
pull_ucs2_talloc(ctx, &str_values[i], cur_str);

View File

@ -80,7 +80,7 @@ ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
status = ads_gen_add(ads, new_dn, mods);
done:
talloc_destroy(ctx);
talloc_free(ctx);
return status;
}
@ -113,7 +113,7 @@ ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
status = ads_gen_add(ads, new_dn, mods);
done:
talloc_destroy(ctx);
talloc_free(ctx);
return status;
}
#endif

View File

@ -321,7 +321,7 @@ static BOOL ads_cleanup_expired_creds(krb5_context context,
krb5_cc_default_name(context),
http_timestring(mem_ctx, credsp->times.endtime)));
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
/* we will probably need new tickets if the current ones
will expire within 10 seconds.

View File

@ -94,7 +94,7 @@ const char **gensec_security_oids(TALLOC_CTX *mem_ctx, const char *skip)
if (!ops) {
return NULL;
}
oid_list = talloc_array_p(mem_ctx, const char *, num_backends + 1);
oid_list = talloc_array(mem_ctx, const char *, num_backends + 1);
if (!oid_list) {
return NULL;
}
@ -123,7 +123,7 @@ const char **gensec_security_oids(TALLOC_CTX *mem_ctx, const char *skip)
*/
static NTSTATUS gensec_start(TALLOC_CTX *mem_ctx, struct gensec_security **gensec_security)
{
(*gensec_security) = talloc_p(mem_ctx, struct gensec_security);
(*gensec_security) = talloc(mem_ctx, struct gensec_security);
if (!(*gensec_security)) {
return NT_STATUS_NO_MEMORY;
}
@ -155,7 +155,7 @@ NTSTATUS gensec_subcontext_start(TALLOC_CTX *mem_ctx,
struct gensec_security *parent,
struct gensec_security **gensec_security)
{
(*gensec_security) = talloc_p(mem_ctx, struct gensec_security);
(*gensec_security) = talloc(mem_ctx, struct gensec_security);
if (!(*gensec_security)) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -62,7 +62,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
{
struct gensec_gssapi_state *gensec_gssapi_state;
gensec_gssapi_state = talloc_p(gensec_security, struct gensec_gssapi_state);
gensec_gssapi_state = talloc(gensec_security, struct gensec_gssapi_state);
if (!gensec_gssapi_state) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -258,7 +258,7 @@ static NTSTATUS gensec_krb5_start(struct gensec_security *gensec_security)
struct gensec_krb5_state *gensec_krb5_state;
krb5_error_code ret = 0;
gensec_krb5_state = talloc_p(gensec_security, struct gensec_krb5_state);
gensec_krb5_state = talloc(gensec_security, struct gensec_krb5_state);
if (!gensec_krb5_state) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -143,7 +143,7 @@ static NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security)
{
struct gensec_ntlmssp_state *gensec_ntlmssp_state;
gensec_ntlmssp_state = talloc_p(gensec_security, struct gensec_ntlmssp_state);
gensec_ntlmssp_state = talloc(gensec_security, struct gensec_ntlmssp_state);
if (!gensec_ntlmssp_state) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -909,7 +909,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx, struct ntlmssp_state **ntlmssp_state)
{
*ntlmssp_state = talloc_p(mem_ctx, struct ntlmssp_state);
*ntlmssp_state = talloc(mem_ctx, struct ntlmssp_state);
if (!*ntlmssp_state) {
DEBUG(0,("ntlmssp_server_start: talloc failed!\n"));
return NT_STATUS_NO_MEMORY;
@ -1269,7 +1269,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
NTSTATUS ntlmssp_client_start(TALLOC_CTX *mem_ctx, struct ntlmssp_state **ntlmssp_state)
{
*ntlmssp_state = talloc_p(mem_ctx, struct ntlmssp_state);
*ntlmssp_state = talloc(mem_ctx, struct ntlmssp_state);
if (!*ntlmssp_state) {
DEBUG(0,("ntlmssp_client_start: talloc failed!\n"));
return NT_STATUS_NO_MEMORY;

View File

@ -54,8 +54,8 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
DATA_BLOB *pointers;
pointers = talloc_array_p(mem_ctx, DATA_BLOB, strlen(format));
intargs = talloc_array_p(pointers, int, strlen(format));
pointers = talloc_array(mem_ctx, DATA_BLOB, strlen(format));
intargs = talloc_array(pointers, int, strlen(format));
/* first scan the format to work out the header and body size */
va_start(ap, format);

View File

@ -289,7 +289,7 @@ NTSTATUS schannel_start(struct schannel_state **state,
const uint8_t session_key[16],
BOOL initiator)
{
(*state) = talloc_p(NULL, struct schannel_state);
(*state) = talloc(NULL, struct schannel_state);
if (!(*state)) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -50,7 +50,7 @@ static NTSTATUS gensec_spnego_client_start(struct gensec_security *gensec_securi
{
struct spnego_state *spnego_state;
spnego_state = talloc_p(gensec_security, struct spnego_state);
spnego_state = talloc(gensec_security, struct spnego_state);
if (!spnego_state) {
return NT_STATUS_NO_MEMORY;
}
@ -68,7 +68,7 @@ static NTSTATUS gensec_spnego_server_start(struct gensec_security *gensec_securi
{
struct spnego_state *spnego_state;
spnego_state = talloc_p(gensec_security, struct spnego_state);
spnego_state = talloc(gensec_security, struct spnego_state);
if (!spnego_state) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -49,7 +49,7 @@ static BOOL read_negTokenInit(struct asn1_data *asn1, struct spnego_negTokenInit
asn1_start_tag(asn1, ASN1_CONTEXT(0));
asn1_start_tag(asn1, ASN1_SEQUENCE(0));
token->mechTypes = talloc_p(NULL, const char *);
token->mechTypes = talloc(NULL, const char *);
for (i = 0; !asn1->has_error &&
0 < asn1_tag_remaining(asn1); i++) {
token->mechTypes = talloc_realloc(NULL,

View File

@ -211,7 +211,7 @@ struct smbcli_state *smbcli_state_init(TALLOC_CTX *mem_ctx)
{
struct smbcli_state *cli;
cli = talloc_zero_p(mem_ctx, struct smbcli_state);
cli = talloc_zero(mem_ctx, struct smbcli_state);
if (cli) {
ZERO_STRUCTP(cli);
}

View File

@ -252,7 +252,7 @@ int smbcli_nt_create_full(struct smbcli_tree *tree, const char *fname,
open_parms.ntcreatex.in.fname = fname;
status = smb_raw_open(tree, mem_ctx, &open_parms);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (NT_STATUS_IS_OK(status)) {
return open_parms.ntcreatex.out.fnum;
@ -319,7 +319,7 @@ int smbcli_open(struct smbcli_tree *tree, const char *fname, int flags,
open_parms.openx.in.fname = fname;
status = smb_raw_open(tree, mem_ctx, &open_parms);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (NT_STATUS_IS_OK(status)) {
return open_parms.openx.out.fnum;
@ -633,7 +633,7 @@ NTSTATUS smbcli_dskattr(struct smbcli_tree *tree, int *bsize, int *total, int *a
*avail = fsinfo_parms.dskattr.out.units_free;
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return status;
}
@ -660,7 +660,7 @@ int smbcli_ctemp(struct smbcli_tree *tree, const char *path, char **tmp_path)
if (tmp_path) {
*tmp_path = strdup(open_parms.ctemp.out.name);
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (NT_STATUS_IS_OK(status)) {
return open_parms.ctemp.out.fnum;
}

View File

@ -147,7 +147,7 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
state.mem_ctx, &first_parms,
(void*)&state, smbcli_list_new_callback);
if (!NT_STATUS_IS_OK(status)) {
talloc_destroy(state.mem_ctx);
talloc_free(state.mem_ctx);
return -1;
}
@ -192,7 +192,7 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
fn(&state.dirlist[i], Mask, caller_state);
}
talloc_destroy(state.mem_ctx);
talloc_free(state.mem_ctx);
return state.total_received;
}
@ -283,7 +283,7 @@ int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
smbcli_list_old_callback);
if (!NT_STATUS_IS_OK(status)) {
talloc_destroy(state.mem_ctx);
talloc_free(state.mem_ctx);
return -1;
}
@ -307,7 +307,7 @@ int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
break;
}
if (!NT_STATUS_IS_OK(status)) {
talloc_destroy(state.mem_ctx);
talloc_free(state.mem_ctx);
return -1;
}
received = next_parms.search_next.out.count;
@ -321,7 +321,7 @@ int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
fn(&state.dirlist[i], Mask, caller_state);
}
talloc_destroy(state.mem_ctx);
talloc_free(state.mem_ctx);
return state.total_received;
}

View File

@ -38,7 +38,7 @@ NTSTATUS smbcli_qpathinfo(struct smbcli_tree *tree, const char *fname,
parms.standard.in.fname = fname;
status = smb_raw_pathinfo(tree, mem_ctx, &parms);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status))
return status;
@ -80,7 +80,7 @@ NTSTATUS smbcli_qpathinfo2(struct smbcli_tree *tree, const char *fname,
parms.all_info.in.fname = fname;
status = smb_raw_pathinfo(tree, mem_ctx, &parms);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status))
return status;
@ -124,14 +124,14 @@ NTSTATUS smbcli_qfilename(struct smbcli_tree *tree, int fnum, const char **name)
status = smb_raw_fileinfo(tree, mem_ctx, &parms);
if (!NT_STATUS_IS_OK(status)) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
*name = NULL;
return status;
}
*name = strdup(parms.name_info.out.fname.s);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return status;
}
@ -157,7 +157,7 @@ NTSTATUS smbcli_qfileinfo(struct smbcli_tree *tree, int fnum,
parms.all_info.in.fnum = fnum;
status = smb_raw_fileinfo(tree, mem_ctx, &parms);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@ -206,7 +206,7 @@ NTSTATUS smbcli_qpathinfo_alt_name(struct smbcli_tree *tree, const char *fname,
status = smb_raw_pathinfo(tree, mem_ctx, &parms);
if (!NT_STATUS_IS_OK(status)) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
*alt_name = NULL;
return smbcli_nt_error(tree);
}
@ -217,7 +217,7 @@ NTSTATUS smbcli_qpathinfo_alt_name(struct smbcli_tree *tree, const char *fname,
*alt_name = strdup(parms.alt_name_info.out.fname.s);
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return NT_STATUS_OK;
}

View File

@ -130,7 +130,7 @@ static struct ldap_parse_tree *ldap_parse_simple(TALLOC_CTX *mem_ctx,
if (val && strchr("()&|", *val))
return NULL;
ret = talloc_p(mem_ctx, struct ldap_parse_tree);
ret = talloc(mem_ctx, struct ldap_parse_tree);
if (!ret) {
errno = ENOMEM;
return NULL;
@ -157,7 +157,7 @@ static struct ldap_parse_tree *ldap_parse_filterlist(TALLOC_CTX *mem_ctx,
{
struct ldap_parse_tree *ret, *next;
ret = talloc_p(mem_ctx, struct ldap_parse_tree);
ret = talloc(mem_ctx, struct ldap_parse_tree);
if (!ret) {
errno = ENOMEM;
return NULL;
@ -165,7 +165,7 @@ static struct ldap_parse_tree *ldap_parse_filterlist(TALLOC_CTX *mem_ctx,
ret->operation = op;
ret->u.list.num_elements = 1;
ret->u.list.elements = talloc_p(mem_ctx, struct ldap_parse_tree *);
ret->u.list.elements = talloc(mem_ctx, struct ldap_parse_tree *);
if (!ret->u.list.elements) {
errno = ENOMEM;
return NULL;
@ -180,7 +180,7 @@ static struct ldap_parse_tree *ldap_parse_filterlist(TALLOC_CTX *mem_ctx,
while (*s && (next = ldap_parse_filter(mem_ctx, &s))) {
struct ldap_parse_tree **e;
e = talloc_realloc_p(ret,
e = talloc_realloc(ret,
ret->u.list.elements,
struct ldap_parse_tree *,
ret->u.list.num_elements+1);
@ -205,7 +205,7 @@ static struct ldap_parse_tree *ldap_parse_not(TALLOC_CTX *mem_ctx, const char *s
{
struct ldap_parse_tree *ret;
ret = talloc_p(mem_ctx, struct ldap_parse_tree);
ret = talloc(mem_ctx, struct ldap_parse_tree);
if (!ret) {
errno = ENOMEM;
return NULL;
@ -448,7 +448,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result)
ldap_push_filter(&data, tree);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}
asn1_push_tag(&data, ASN1_SEQUENCE(0));
@ -1186,7 +1186,7 @@ BOOL ldap_decode(struct asn1_data *data, struct ldap_message *msg)
for (i=0; asn1_peek_tag(data, ASN1_SEQUENCE(0)); i++) {
asn1_start_tag(data, ASN1_SEQUENCE(0));
ctrl = talloc_realloc_p(msg->mem_ctx, ctrl, struct ldap_Control, i+1);
ctrl = talloc_realloc(msg->mem_ctx, ctrl, struct ldap_Control, i+1);
if (!ctrl) {
return False;
}

View File

@ -100,7 +100,7 @@ static struct ldap_connection *new_ldap_connection(TALLOC_CTX *mem_ctx)
{
struct ldap_connection *result;
result = talloc_p(mem_ctx, struct ldap_connection);
result = talloc(mem_ctx, struct ldap_connection);
if (!result) {
return NULL;
@ -158,7 +158,7 @@ struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx)
{
struct ldap_message *result;
result = talloc_p(mem_ctx, struct ldap_message);
result = talloc(mem_ctx, struct ldap_message);
if (!result) {
return NULL;
@ -472,7 +472,7 @@ int ldap_bind_sasl(struct ldap_connection *conn, const char *username, const cha
done:
if (mem_ctx)
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return result;
}

View File

@ -159,7 +159,7 @@ static int next_attr(char **s, const char **attr, struct ldap_val *value)
BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldap_val *value,
struct ldap_attribute *attrib)
{
attrib->values = talloc_realloc_p(mem_ctx,
attrib->values = talloc_realloc(mem_ctx,
attrib->values,
DATA_BLOB,
attrib->num_values+1);
@ -177,7 +177,7 @@ BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx,
struct ldap_attribute **attribs,
int *num_attribs)
{
*attribs = talloc_realloc_p(mem_ctx,
*attribs = talloc_realloc(mem_ctx,
*attribs,
struct ldap_attribute,
*num_attribs+1);
@ -211,7 +211,7 @@ static BOOL fill_add_attributes(struct ldap_message *msg, char **chunk)
}
if (attrib == NULL) {
r->attributes = talloc_realloc_p(msg->mem_ctx,
r->attributes = talloc_realloc(msg->mem_ctx,
r->attributes,
struct ldap_attribute,
r->num_attributes+1);
@ -236,7 +236,7 @@ BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx,
struct ldap_mod **mods,
int *num_mods)
{
*mods = talloc_realloc_p(mem_ctx, *mods, struct ldap_mod, (*num_mods)+1);
*mods = talloc_realloc(mem_ctx, *mods, struct ldap_mod, (*num_mods)+1);
if (*mods == NULL)
return False;

View File

@ -81,7 +81,7 @@ NTSTATUS smb_raw_query_secdesc_recv(struct smbcli_request *req,
return NT_STATUS_INVALID_PARAMETER;
}
io->query_secdesc.out.sd = talloc_p(mem_ctx, struct security_descriptor);
io->query_secdesc.out.sd = talloc(mem_ctx, struct security_descriptor);
if (!io->query_secdesc.out.sd) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -187,7 +187,7 @@ NTSTATUS ea_pull_list(const DATA_BLOB *blob,
blob2.data = blob->data + ofs;
blob2.length = ea_size - ofs;
*eas = talloc_realloc_p(mem_ctx, *eas, struct ea_struct, n+1);
*eas = talloc_realloc(mem_ctx, *eas, struct ea_struct, n+1);
if (! *eas) return NT_STATUS_NO_MEMORY;
len = ea_pull_struct(&blob2, mem_ctx, &(*eas)[n]);
@ -232,7 +232,7 @@ NTSTATUS ea_pull_list_chained(const DATA_BLOB *blob,
blob2.data = blob->data + ofs + 4;
blob2.length = blob->length - (ofs + 4);
*eas = talloc_realloc_p(mem_ctx, *eas, struct ea_struct, n+1);
*eas = talloc_realloc(mem_ctx, *eas, struct ea_struct, n+1);
if (! *eas) return NT_STATUS_NO_MEMORY;
len = ea_pull_struct(&blob2, mem_ctx, &(*eas)[n]);
@ -312,7 +312,7 @@ NTSTATUS ea_pull_name_list(const DATA_BLOB *blob,
blob2.data = blob->data + ofs;
blob2.length = ea_size - ofs;
*ea_names = talloc_realloc_p(mem_ctx, *ea_names, struct ea_name, n+1);
*ea_names = talloc_realloc(mem_ctx, *ea_names, struct ea_name, n+1);
if (! *ea_names) return NT_STATUS_NO_MEMORY;
len = ea_pull_name(&blob2, mem_ctx, &(*ea_names)[n]);

View File

@ -140,7 +140,7 @@ static struct smbcli_request *smb_raw_t2mkdir_send(struct smbcli_tree *tree,
req = smb_raw_trans2_send(tree, &t2);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}
@ -383,7 +383,7 @@ static struct smbcli_request *smb_raw_t2open_send(struct smbcli_tree *tree,
req = smb_raw_trans2_send(tree, &t2);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}

View File

@ -182,7 +182,7 @@ static NTSTATUS smb_raw_info_backend(struct smbcli_session *session,
while (blob->length - ofs >= 24) {
uint_t n = parms->stream_info.out.num_streams;
parms->stream_info.out.streams =
talloc_realloc_p(mem_ctx,
talloc_realloc(mem_ctx,
parms->stream_info.out.streams,
struct stream_struct,
n+1);
@ -306,7 +306,7 @@ static struct smbcli_request *smb_raw_fileinfo_blob_send(struct smbcli_tree *tre
tp.in.params = data_blob_talloc(mem_ctx, NULL, 4);
if (!tp.in.params.data) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return NULL;
}
@ -315,7 +315,7 @@ static struct smbcli_request *smb_raw_fileinfo_blob_send(struct smbcli_tree *tre
req = smb_raw_trans2_send(tree, &tp);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}
@ -360,7 +360,7 @@ static struct smbcli_request *smb_raw_pathinfo_blob_send(struct smbcli_tree *tre
tp.in.params = data_blob_talloc(mem_ctx, NULL, 6);
if (!tp.in.params.data) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return NULL;
}
@ -371,7 +371,7 @@ static struct smbcli_request *smb_raw_pathinfo_blob_send(struct smbcli_tree *tre
req = smb_raw_trans2_send(tree, &tp);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}

View File

@ -67,7 +67,7 @@ struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *tran
{
struct smbcli_request *req;
req = talloc_p(transport, struct smbcli_request);
req = talloc(transport, struct smbcli_request);
if (!req) {
return NULL;
}

View File

@ -274,7 +274,7 @@ struct smbcli_request *smb_raw_setfileinfo_send(struct smbcli_tree *tree,
if (!mem_ctx) return NULL;
if (!smb_raw_setinfo_backend(tree, mem_ctx, parms, &blob)) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return NULL;
}
@ -285,7 +285,7 @@ struct smbcli_request *smb_raw_setfileinfo_send(struct smbcli_tree *tree,
parms->generic.level,
&blob);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}
@ -321,7 +321,7 @@ struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
if (!mem_ctx) return NULL;
if (!smb_raw_setinfo_backend(tree, mem_ctx, parms, &blob)) {
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return NULL;
}
@ -332,7 +332,7 @@ struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
parms->generic.level,
&blob);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return req;
}

View File

@ -149,12 +149,12 @@ struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr)
if (sidstr[i] == '-') num_sub_auths++;
}
ret = talloc_p(mem_ctx, struct dom_sid);
ret = talloc(mem_ctx, struct dom_sid);
if (!ret) {
return NULL;
}
ret->sub_auths = talloc_array_p(mem_ctx, uint32_t, num_sub_auths);
ret->sub_auths = talloc_array(mem_ctx, uint32_t, num_sub_auths);
if (!ret->sub_auths) {
return NULL;
}
@ -190,12 +190,12 @@ struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid)
{
struct dom_sid *ret;
int i;
ret = talloc_p(mem_ctx, struct dom_sid);
ret = talloc(mem_ctx, struct dom_sid);
if (!ret) {
return NULL;
}
ret->sub_auths = talloc_array_p(ret, uint32_t, dom_sid->num_auths);
ret->sub_auths = talloc_array(ret, uint32_t, dom_sid->num_auths);
if (!ret->sub_auths) {
return NULL;
}
@ -226,12 +226,12 @@ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
{
struct dom_sid *sid;
sid = talloc_p(mem_ctx, struct dom_sid);
sid = talloc(mem_ctx, struct dom_sid);
if (!sid) return NULL;
*sid = *domain_sid;
sid->sub_auths = talloc_array_p(sid, uint32_t, sid->num_auths+1);
sid->sub_auths = talloc_array(sid, uint32_t, sid->num_auths+1);
if (!sid->sub_auths) {
return NULL;
}

View File

@ -30,7 +30,7 @@ struct security_descriptor *security_descriptor_initialise(TALLOC_CTX *mem_ctx)
{
struct security_descriptor *sd;
sd = talloc_p(mem_ctx, struct security_descriptor);
sd = talloc(mem_ctx, struct security_descriptor);
if (!sd) {
return NULL;
}
@ -72,7 +72,7 @@ NTSTATUS security_descriptor_dacl_add(struct security_descriptor *sd,
const struct security_ace *ace)
{
if (sd->dacl == NULL) {
sd->dacl = talloc_p(sd, struct security_acl);
sd->dacl = talloc(sd, struct security_acl);
if (sd->dacl == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -82,7 +82,7 @@ NTSTATUS security_descriptor_dacl_add(struct security_descriptor *sd,
sd->dacl->aces = NULL;
}
sd->dacl->aces = talloc_realloc_p(sd->dacl, sd->dacl->aces,
sd->dacl->aces = talloc_realloc(sd->dacl, sd->dacl->aces,
struct security_ace, sd->dacl->num_aces+1);
if (sd->dacl->aces == NULL) {
return NT_STATUS_NO_MEMORY;
@ -257,7 +257,7 @@ struct security_descriptor *security_descriptor_create(TALLOC_CTX *mem_ctx,
va_start(ap, group_sid);
while ((sidstr = va_arg(ap, const char *))) {
struct dom_sid *sid;
struct security_ace *ace = talloc_p(sd, struct security_ace);
struct security_ace *ace = talloc(sd, struct security_ace);
NTSTATUS status;
if (ace == NULL) {

View File

@ -31,7 +31,7 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx)
{
struct security_token *st;
st = talloc_p(mem_ctx, struct security_token);
st = talloc(mem_ctx, struct security_token);
if (!st) {
return NULL;
}
@ -63,7 +63,7 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
ptoken = security_token_initialise(mem_ctx);
NT_STATUS_HAVE_NO_MEMORY(ptoken);
ptoken->sids = talloc_array_p(ptoken, struct dom_sid *, n_groupSIDs + 5);
ptoken->sids = talloc_array(ptoken, struct dom_sid *, n_groupSIDs + 5);
NT_STATUS_HAVE_NO_MEMORY(ptoken->sids);
ptoken->user_sid = talloc_reference(ptoken, user_sid);
@ -163,5 +163,5 @@ void security_token_debug(int dbg_lev, const struct security_token *token)
}
}
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
}

View File

@ -59,7 +59,7 @@ BOOL asn1_push_tag(struct asn1_data *data, uint8_t tag)
struct nesting *nesting;
asn1_write_uint8(data, tag);
nesting = talloc_p(NULL, struct nesting);
nesting = talloc(NULL, struct nesting);
if (!nesting) {
data->has_error = True;
return False;
@ -349,7 +349,7 @@ BOOL asn1_start_tag(struct asn1_data *data, uint8_t tag)
data->has_error = True;
return False;
}
nesting = talloc_p(NULL, struct nesting);
nesting = talloc(NULL, struct nesting);
if (!nesting) {
data->has_error = True;
return False;

View File

@ -53,7 +53,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
return NT_STATUS_OK;
}
lsa = talloc_p(cli, struct smblsa_state);
lsa = talloc(cli, struct smblsa_state);
if (lsa == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -217,7 +217,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli,
names.names = NULL;
sids.num_sids = 1;
sids.sids = talloc_p(mem_ctx2, struct lsa_SidPtr);
sids.sids = talloc(mem_ctx2, struct lsa_SidPtr);
sids.sids[0].sid = sid;
r.in.handle = &cli->lsa->handle;

View File

@ -344,7 +344,7 @@ static DATA_BLOB NTLMv2_generate_response(const uint8_t ntlm_v2_hash[16],
memcpy(final_response.data+sizeof(ntlmv2_response),
ntlmv2_client_data.data, ntlmv2_client_data.length);
talloc_destroy(mem_ctx);
talloc_free(mem_ctx);
return final_response;
}

View File

@ -28,7 +28,7 @@ struct libnet_context *libnet_context_init(void)
mem_ctx = talloc_init("libnet_context");
ctx = talloc_p(mem_ctx, struct libnet_context);
ctx = talloc(mem_ctx, struct libnet_context);
if (!ctx) {
return NULL;
}
@ -40,7 +40,7 @@ struct libnet_context *libnet_context_init(void)
void libnet_context_destroy(struct libnet_context **libnetctx)
{
talloc_destroy((*libnetctx)->mem_ctx);
talloc_free((*libnetctx)->mem_ctx);
(*libnetctx) = NULL;
}

View File

@ -170,7 +170,7 @@ static NTSTATUS libnet_JoinDomain_samr(struct libnet_context *ctx,
/* prepare samr_LookupNames */
ln.in.domain_handle = &d_handle;
ln.in.num_names = 1;
ln.in.names = talloc_array_p(mem_ctx, struct samr_String, 1);
ln.in.names = talloc_array(mem_ctx, struct samr_String, 1);
if (!ln.in.names) {
r->samr.out.error_string = "Out of Memory";
return NT_STATUS_NO_MEMORY;

View File

@ -578,7 +578,7 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
/* prepare samr_LookupNames */
ln.in.domain_handle = &d_handle;
ln.in.num_names = 1;
ln.in.names = talloc_array_p(mem_ctx, struct samr_String, 1);
ln.in.names = talloc_array(mem_ctx, struct samr_String, 1);
if (!ln.in.names) {
r->samr.out.error_string = "Out of Memory";
return NT_STATUS_NO_MEMORY;

View File

@ -48,7 +48,7 @@ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
{
struct ndr_pull *ndr;
ndr = talloc_zero_p(mem_ctx, struct ndr_pull);
ndr = talloc_zero(mem_ctx, struct ndr_pull);
if (!ndr) return NULL;
ndr->data = blob->data;
@ -121,14 +121,14 @@ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
{
struct ndr_push *ndr;
ndr = talloc_zero_p(mem_ctx, struct ndr_push);
ndr = talloc_zero(mem_ctx, struct ndr_push);
if (!ndr) {
return NULL;
}
ndr->flags = 0;
ndr->alloc_size = NDR_BASE_MARSHALL_SIZE;
ndr->data = talloc_array_p(ndr, uint8_t, ndr->alloc_size);
ndr->data = talloc_array(ndr, uint8_t, ndr->alloc_size);
if (!ndr->data) {
return NULL;
}
@ -315,7 +315,7 @@ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
{
struct ndr_print *ndr;
ndr = talloc_p(NULL, struct ndr_print);
ndr = talloc(NULL, struct ndr_print);
if (!ndr) return;
ndr->print = ndr_print_debug_helper;
ndr->depth = 1;
@ -332,7 +332,7 @@ void ndr_print_union_debug(ndr_print_union_fn_t fn, const char *name, uint32_t l
{
struct ndr_print *ndr;
ndr = talloc_p(NULL, struct ndr_print);
ndr = talloc(NULL, struct ndr_print);
if (!ndr) return;
ndr->print = ndr_print_debug_helper;
ndr->depth = 1;
@ -348,7 +348,7 @@ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int fla
{
struct ndr_print *ndr;
ndr = talloc_p(NULL, struct ndr_print);
ndr = talloc(NULL, struct ndr_print);
if (!ndr) return;
ndr->print = ndr_print_debug_helper;
ndr->depth = 1;
@ -639,7 +639,7 @@ static NTSTATUS ndr_token_store(TALLOC_CTX *mem_ctx,
uint32_t value)
{
struct ndr_token_list *tok;
tok = talloc_p(mem_ctx, struct ndr_token_list);
tok = talloc(mem_ctx, struct ndr_token_list);
if (tok == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -37,7 +37,7 @@ NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DU
NDR_CHECK(ndr_pull_uint16(ndr, &num_entries));
NDR_CHECK(ndr_pull_uint16(ndr, &security_offset));
ar->stringbindings = talloc_array_p(ndr, struct STRINGBINDING *, num_entries);
ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries);
ar->stringbindings[0] = NULL;
do {
@ -46,8 +46,8 @@ NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DU
if (towerid > 0) {
ndr->offset -= 2;
ar->stringbindings = talloc_realloc_p(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
ar->stringbindings[towernum] = talloc_p(ndr, struct STRINGBINDING);
ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING);
NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum]));
towernum++;
}
@ -56,7 +56,7 @@ NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DU
ar->stringbindings[towernum] = NULL;
towernum = 0;
ar->securitybindings = talloc_array_p(ndr, struct SECURITYBINDING *, num_entries);
ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries);
ar->securitybindings[0] = NULL;
do {
@ -65,8 +65,8 @@ NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DU
if (towerid > 0) {
ndr->offset -= 2;
ar->securitybindings = talloc_realloc_p(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2);
ar->securitybindings[towernum] = talloc_p(ndr, struct SECURITYBINDING);
ar->securitybindings = talloc_realloc(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2);
ar->securitybindings[towernum] = talloc(ndr, struct SECURITYBINDING);
NDR_CHECK(ndr_pull_SECURITYBINDING(ndr, ndr_flags, ar->securitybindings[towernum]));
towernum++;
}
@ -126,7 +126,7 @@ NTSTATUS ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRING
NDR_CHECK(ndr_pull_uint16(ndr, &num_entries));
ar->stringbindings = talloc_array_p(ndr, struct STRINGBINDING *, 1);
ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1);
ar->stringbindings[0] = NULL;
do {
@ -135,8 +135,8 @@ NTSTATUS ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRING
if (towerid > 0) {
ndr->offset -= 2;
ar->stringbindings = talloc_realloc_p(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
ar->stringbindings[towernum] = talloc_p(ndr, struct STRINGBINDING);
ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING);
NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum]));
towernum++;
}

View File

@ -33,7 +33,7 @@ static struct dcerpc_interface_list *dcerpc_pipes = NULL;
*/
NTSTATUS librpc_register_interface(const struct dcerpc_interface_table *interface)
{
struct dcerpc_interface_list *l = talloc_p(talloc_autofree_context(),
struct dcerpc_interface_list *l = talloc(talloc_autofree_context(),
struct dcerpc_interface_list);
if (idl_iface_by_name (interface->name) != NULL) {
@ -96,7 +96,7 @@ struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx)
{
struct dcerpc_pipe *p;
p = talloc_p(mem_ctx, struct dcerpc_pipe);
p = talloc(mem_ctx, struct dcerpc_pipe);
if (!p) {
return NULL;
}
@ -534,7 +534,7 @@ static NTSTATUS full_request(struct dcerpc_connection *c,
DATA_BLOB *request_blob,
DATA_BLOB *reply_blob)
{
struct full_request_state *state = talloc_p(mem_ctx, struct full_request_state);
struct full_request_state *state = talloc(mem_ctx, struct full_request_state);
NTSTATUS status;
if (state == NULL) {
@ -864,7 +864,7 @@ struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
p->conn->transport.recv_data = dcerpc_request_recv_data;
req = talloc_p(mem_ctx, struct rpc_request);
req = talloc(mem_ctx, struct rpc_request);
if (req == NULL) {
return NULL;
}

View File

@ -227,7 +227,7 @@ static NTSTATUS dcerpc_schannel_update(struct gensec_security *gensec_security,
NTSTATUS dcerpc_schannel_session_info(struct gensec_security *gensec_security,
struct auth_session_info **session_info)
{
(*session_info) = talloc_p(gensec_security, struct auth_session_info);
(*session_info) = talloc(gensec_security, struct auth_session_info);
NT_STATUS_HAVE_NO_MEMORY(*session_info);
ZERO_STRUCTP(*session_info);
@ -271,7 +271,7 @@ static NTSTATUS dcerpc_schannel_start(struct gensec_security *gensec_security)
{
struct dcerpc_schannel_state *dce_schan_state;
dce_schan_state = talloc_p(gensec_security, struct dcerpc_schannel_state);
dce_schan_state = talloc(gensec_security, struct dcerpc_schannel_state);
if (!dce_schan_state) {
return NT_STATUS_NO_MEMORY;
}
@ -470,7 +470,7 @@ NTSTATUS dcerpc_bind_auth_schannel(struct dcerpc_pipe *p,
NTSTATUS status;
int chan_type = 0;
struct creds_CredentialState *creds;
creds = talloc_p(p, struct creds_CredentialState);
creds = talloc(p, struct creds_CredentialState);
if (!creds) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -123,7 +123,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO
struct smb_read_state *state;
struct smbcli_request *req;
state = talloc_p(smb, struct smb_read_state);
state = talloc(smb, struct smb_read_state);
if (state == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -144,7 +144,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO
memcpy(state->data.data, blob->data, blob->length);
}
state->io = talloc_p(state, union smb_read);
state->io = talloc(state, union smb_read);
io = state->io;
io->generic.level = RAW_READ_READX;
@ -222,13 +222,13 @@ static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *b
uint16 setup[2];
struct smb_trans_state *state;
state = talloc_p(smb, struct smb_trans_state);
state = talloc(smb, struct smb_trans_state);
if (state == NULL) {
return NT_STATUS_NO_MEMORY;
}
state->c = c;
state->trans = talloc_p(state, struct smb_trans2);
state->trans = talloc(state, struct smb_trans2);
trans = state->trans;
trans->in.data = *blob;
@ -418,7 +418,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_connection *c,
/* Over-ride the default session key with the SMB session key */
c->security_state.session_key = smb_session_key;
smb = talloc_p(c, struct smb_private);
smb = talloc(c, struct smb_private);
if (smb == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -237,7 +237,7 @@ static NTSTATUS sock_send_request(struct dcerpc_connection *p, DATA_BLOB *data,
return NT_STATUS_CONNECTION_DISCONNECTED;
}
blob = talloc_p(sock, struct sock_blob);
blob = talloc(sock, struct sock_blob);
if (blob == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -302,7 +302,7 @@ static NTSTATUS dcerpc_pipe_open_socket(struct dcerpc_connection *c,
struct fd_event fde;
NTSTATUS status;
sock = talloc_p(c, struct sock_private);
sock = talloc(c, struct sock_private);
if (!sock) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -324,7 +324,7 @@ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_
comma_count = count_chars(options, ',');
b->options = talloc_array_p(mem_ctx, const char *, comma_count+2);
b->options = talloc_array(mem_ctx, const char *, comma_count+2);
if (!b->options) {
return NT_STATUS_NO_MEMORY;
}
@ -631,7 +631,7 @@ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *
}
tower->num_floors = 2 + num_protocols;
tower->floors = talloc_array_p(mem_ctx, struct epm_floor, tower->num_floors);
tower->floors = talloc_array(mem_ctx, struct epm_floor, tower->num_floors);
/* Floor 0 */
tower->floors[0].lhs.protocol = EPM_PROTOCOL_UUID;

View File

@ -201,7 +201,7 @@ static void async_simple(struct smbcli_request *c_req)
if (!c_req) return NT_STATUS_UNSUCCESSFUL; \
{ \
struct async_info *async; \
async = talloc_p(req, struct async_info); \
async = talloc(req, struct async_info); \
if (!async) return NT_STATUS_NO_MEMORY; \
async->parms = io; \
async->req = req; \

View File

@ -78,7 +78,7 @@ struct brl_context *brl_init(TALLOC_CTX *mem_ctx, servid_t server, uint16_t tid,
char *path;
struct brl_context *brl;
brl = talloc_p(mem_ctx, struct brl_context);
brl = talloc(mem_ctx, struct brl_context);
if (brl == NULL) {
return NULL;
}

View File

@ -84,7 +84,7 @@ struct odb_context *odb_init(TALLOC_CTX *mem_ctx, servid_t server,
char *path;
struct odb_context *odb;
odb = talloc_p(mem_ctx, struct odb_context);
odb = talloc(mem_ctx, struct odb_context);
if (odb == NULL) {
return NULL;
}
@ -124,7 +124,7 @@ struct odb_lock *odb_lock(TALLOC_CTX *mem_ctx,
{
struct odb_lock *lck;
lck = talloc_p(mem_ctx, struct odb_lock);
lck = talloc(mem_ctx, struct odb_lock);
if (lck == NULL) {
return NULL;
}

View File

@ -45,7 +45,7 @@ struct sidmap_context {
struct sidmap_context *sidmap_open(TALLOC_CTX *mem_ctx)
{
struct sidmap_context *sidmap;
sidmap = talloc_p(mem_ctx, struct sidmap_context);
sidmap = talloc(mem_ctx, struct sidmap_context);
if (sidmap == NULL) {
return NULL;
}

View File

@ -77,7 +77,7 @@ static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx,
{
struct rap_call *call;
call = talloc_p(mem_ctx, struct rap_call);
call = talloc(mem_ctx, struct rap_call);
if (call == NULL)
return NULL;
@ -92,7 +92,7 @@ static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx,
call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx);
call->ndr_pull_data->flags = RAPNDR_FLAGS;
call->heap = talloc_p(mem_ctx, struct rap_string_heap);
call->heap = talloc(mem_ctx, struct rap_string_heap);
if (call->heap == NULL)
return NULL;
@ -179,7 +179,7 @@ static NTSTATUS rap_push_string(struct ndr_push *data_push,
NDR_CHECK(ndr_push_uint16(data_push, heap->offset));
NDR_CHECK(ndr_push_uint16(data_push, 0));
heap->strings = talloc_realloc_p(heap->mem_ctx,
heap->strings = talloc_realloc(heap->mem_ctx,
heap->strings,
const char *,
heap->num_strings + 1);

View File

@ -32,7 +32,7 @@ NTSTATUS rap_netshareenum(struct smbsrv_request *req,
int i;
r->out.status = 0;
r->out.available = dcesrv_common_get_count_of_shares(req, NULL);
r->out.info = talloc_array_p(req,
r->out.info = talloc_array(req,
union rap_shareenum_info, r->out.available);
for (i=0;i<r->out.available;i++) {

View File

@ -97,7 +97,7 @@ static NTSTATUS nbench_connect(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
char *logname = NULL;
nprivates = talloc_p(req->tcon, struct nbench_private);
nprivates = talloc(req->tcon, struct nbench_private);
if (!nprivates) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -79,7 +79,7 @@ static NTSTATUS ntvfs_map_async_setup(struct smbsrv_request *req,
second_stage_t fn)
{
struct ntvfs_map_async *m;
m = talloc_p(req, struct ntvfs_map_async);
m = talloc(req, struct ntvfs_map_async);
if (m == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -217,7 +217,7 @@ static NTSTATUS ntvfs_map_open_finish(struct smbsrv_request *req,
req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC;
if (write_time != 0) {
sf = talloc_p(req, union smb_setfileinfo);
sf = talloc(req, union smb_setfileinfo);
sf->generic.level = RAW_SFILEINFO_STANDARD;
sf->generic.file.fnum = io2->generic.out.fnum;
sf->standard.in.create_time = 0;
@ -227,7 +227,7 @@ static NTSTATUS ntvfs_map_open_finish(struct smbsrv_request *req,
}
if (set_size != 0) {
sf = talloc_p(req, union smb_setfileinfo);
sf = talloc(req, union smb_setfileinfo);
sf->generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
sf->generic.file.fnum = io2->generic.out.fnum;
sf->end_of_file_info.in.size = set_size;
@ -351,7 +351,7 @@ NTSTATUS ntvfs_map_open(struct smbsrv_request *req, union smb_open *io,
NTSTATUS status;
union smb_open *io2;
io2 = talloc_zero_p(req, union smb_open);
io2 = talloc_zero(req, union smb_open);
if (io2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -417,7 +417,7 @@ NTSTATUS ntvfs_map_open(struct smbsrv_request *req, union smb_open *io,
io2->generic.in.file_attr = io->t2open.in.file_attrs;
io2->generic.in.fname = io->t2open.in.fname;
io2->generic.in.ea_list = talloc_p(io2, struct smb_ea_list);
io2->generic.in.ea_list = talloc(io2, struct smb_ea_list);
io2->generic.in.ea_list->num_eas = io->t2open.in.num_eas;
io2->generic.in.ea_list->eas = io->t2open.in.eas;
@ -485,7 +485,7 @@ NTSTATUS ntvfs_map_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs,
NTSTATUS status;
union smb_fsinfo *fs2;
fs2 = talloc_p(req, union smb_fsinfo);
fs2 = talloc(req, union smb_fsinfo);
if (fs2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -714,7 +714,7 @@ NTSTATUS ntvfs_map_fileinfo(struct smbsrv_request *req, union smb_fileinfo *info
info->stream_info.out.num_streams = info2->generic.out.num_streams;
if (info->stream_info.out.num_streams > 0) {
info->stream_info.out.streams =
talloc_array_p(req,
talloc_array(req,
struct stream_struct,
info->stream_info.out.num_streams);
if (!info->stream_info.out.streams) {
@ -753,7 +753,7 @@ NTSTATUS ntvfs_map_fileinfo(struct smbsrv_request *req, union smb_fileinfo *info
case RAW_FILEINFO_ALL_EAS:
info->all_eas.out.num_eas = info2->generic.out.num_eas;
if (info->all_eas.out.num_eas > 0) {
info->all_eas.out.eas = talloc_array_p(req,
info->all_eas.out.eas = talloc_array(req,
struct ea_struct,
info->all_eas.out.num_eas);
if (!info->all_eas.out.eas) {
@ -840,7 +840,7 @@ NTSTATUS ntvfs_map_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *inf
NTSTATUS status;
union smb_fileinfo *info2;
info2 = talloc_p(req, union smb_fileinfo);
info2 = talloc(req, union smb_fileinfo);
if (info2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -869,7 +869,7 @@ NTSTATUS ntvfs_map_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *inf
NTSTATUS status;
union smb_fileinfo *info2;
info2 = talloc_p(req, union smb_fileinfo);
info2 = talloc(req, union smb_fileinfo);
if (info2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -902,12 +902,12 @@ NTSTATUS ntvfs_map_lock(struct smbsrv_request *req, union smb_lock *lck,
union smb_lock *lck2;
struct smb_lock_entry *locks;
lck2 = talloc_p(req, union smb_lock);
lck2 = talloc(req, union smb_lock);
if (lck2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
locks = talloc_array_p(lck2, struct smb_lock_entry, 1);
locks = talloc_array(lck2, struct smb_lock_entry, 1);
if (locks == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -966,7 +966,7 @@ static NTSTATUS ntvfs_map_write_finish(struct smbsrv_request *req,
case RAW_WRITE_WRITEUNLOCK:
wr->writeunlock.out.nwritten = wr2->generic.out.nwritten;
lck = talloc_p(wr2, union smb_lock);
lck = talloc(wr2, union smb_lock);
if (lck == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -988,7 +988,7 @@ static NTSTATUS ntvfs_map_write_finish(struct smbsrv_request *req,
case RAW_WRITE_WRITECLOSE:
wr->writeclose.out.nwritten = wr2->generic.out.nwritten;
cl = talloc_p(wr2, union smb_close);
cl = talloc(wr2, union smb_close);
if (cl == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -1025,7 +1025,7 @@ NTSTATUS ntvfs_map_write(struct smbsrv_request *req, union smb_write *wr,
union smb_write *wr2;
NTSTATUS status;
wr2 = talloc_p(req, union smb_write);
wr2 = talloc(req, union smb_write);
if (wr2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -1125,7 +1125,7 @@ NTSTATUS ntvfs_map_read(struct smbsrv_request *req, union smb_read *rd,
NTSTATUS status;
uint_t state;
rd2 = talloc_p(req, union smb_read);
rd2 = talloc(req, union smb_read);
if (rd2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -1168,7 +1168,7 @@ NTSTATUS ntvfs_map_read(struct smbsrv_request *req, union smb_read *rd,
state = req->async_states->state;
req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC;
lck = talloc_p(rd2, union smb_lock);
lck = talloc(rd2, union smb_lock);
if (lck == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
@ -1206,7 +1206,7 @@ NTSTATUS ntvfs_map_close(struct smbsrv_request *req, union smb_close *cl,
{
union smb_close *cl2;
cl2 = talloc_p(req, union smb_close);
cl2 = talloc(req, union smb_close);
if (cl2 == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -33,7 +33,7 @@ NTSTATUS ntvfs_async_state_push(struct smbsrv_request *req,
{
struct ntvfs_async_state *async;
async = talloc_p(req, struct ntvfs_async_state);
async = talloc(req, struct ntvfs_async_state);
if (!async) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -195,7 +195,7 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
uid_t uid = -1;
gid_t gid = -1;
acl = talloc_p(req, struct xattr_NTACL);
acl = talloc(req, struct xattr_NTACL);
if (acl == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -289,7 +289,7 @@ NTSTATUS pvfs_acl_query(struct pvfs_state *pvfs,
NTSTATUS status;
struct security_descriptor *sd;
acl = talloc_p(req, struct xattr_NTACL);
acl = talloc(req, struct xattr_NTACL);
if (acl == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -367,7 +367,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
NTSTATUS status;
struct security_descriptor *sd;
acl = talloc_p(req, struct xattr_NTACL);
acl = talloc(req, struct xattr_NTACL);
if (acl == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -595,7 +595,7 @@ NTSTATUS pvfs_acl_inherit(struct pvfs_state *pvfs,
return status;
}
acl = talloc_p(req, struct xattr_NTACL);
acl = talloc(req, struct xattr_NTACL);
if (acl == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -97,7 +97,7 @@ NTSTATUS pvfs_list_start(struct pvfs_state *pvfs, struct pvfs_filename *name,
char *pattern;
struct pvfs_dir *dir;
(*dirp) = talloc_zero_p(mem_ctx, struct pvfs_dir);
(*dirp) = talloc_zero(mem_ctx, struct pvfs_dir);
if (*dirp == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -296,7 +296,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
if (lck->lockx.in.timeout != 0 &&
(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
pending = talloc_p(f, struct pvfs_pending_lock);
pending = talloc(f, struct pvfs_pending_lock);
if (pending == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -180,12 +180,12 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
return NT_STATUS_INVALID_PARAMETER;
}
f = talloc_p(req, struct pvfs_file);
f = talloc(req, struct pvfs_file);
if (f == NULL) {
return NT_STATUS_NO_MEMORY;
}
f->handle = talloc_p(f, struct pvfs_file_handle);
f->handle = talloc(f, struct pvfs_file_handle);
if (f->handle == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -468,12 +468,12 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
flags = O_RDONLY;
}
f = talloc_p(req, struct pvfs_file);
f = talloc(req, struct pvfs_file);
if (f == NULL) {
return NT_STATUS_NO_MEMORY;
}
f->handle = talloc_p(f, struct pvfs_file_handle);
f->handle = talloc(f, struct pvfs_file_handle);
if (f->handle == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -805,7 +805,7 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
}
}
r = talloc_p(req, struct pvfs_open_retry);
r = talloc(req, struct pvfs_open_retry);
if (r == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -962,12 +962,12 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
return status;
}
f = talloc_p(req, struct pvfs_file);
f = talloc(req, struct pvfs_file);
if (f == NULL) {
return NT_STATUS_NO_MEMORY;
}
f->handle = talloc_p(f, struct pvfs_file_handle);
f->handle = talloc(f, struct pvfs_file_handle);
if (f->handle == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -64,14 +64,14 @@ NTSTATUS pvfs_query_ea_list(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
int i;
struct xattr_DosEAs *ealist = talloc_p(mem_ctx, struct xattr_DosEAs);
struct xattr_DosEAs *ealist = talloc(mem_ctx, struct xattr_DosEAs);
ZERO_STRUCTP(eas);
status = pvfs_doseas_load(pvfs, name, fd, ealist);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
eas->eas = talloc_array_p(mem_ctx, struct ea_struct, num_names);
eas->eas = talloc_array(mem_ctx, struct ea_struct, num_names);
if (eas->eas == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -101,14 +101,14 @@ static NTSTATUS pvfs_query_all_eas(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
int i;
struct xattr_DosEAs *ealist = talloc_p(mem_ctx, struct xattr_DosEAs);
struct xattr_DosEAs *ealist = talloc(mem_ctx, struct xattr_DosEAs);
ZERO_STRUCTP(eas);
status = pvfs_doseas_load(pvfs, name, fd, ealist);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
eas->eas = talloc_array_p(mem_ctx, struct ea_struct, ealist->num_eas);
eas->eas = talloc_array(mem_ctx, struct ea_struct, ealist->num_eas);
if (eas->eas == NULL) {
return NT_STATUS_NO_MEMORY;
}

Some files were not shown because too many files have changed in this diff Show More