mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
This commit is contained in:
parent
3d15137653
commit
d5e6a47f06
@ -219,7 +219,6 @@ copy an IP address from one buffer to another
|
||||
#define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count))
|
||||
|
||||
#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
|
||||
#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
|
||||
#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
|
||||
#define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
|
||||
#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
|
||||
|
@ -29,7 +29,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
|
||||
{
|
||||
struct bitmap *bm;
|
||||
|
||||
bm = TALLOC_P(mem_ctx, struct bitmap);
|
||||
bm = talloc(mem_ctx, struct bitmap);
|
||||
|
||||
if (!bm) return NULL;
|
||||
|
||||
|
@ -304,7 +304,7 @@ static struct messaging_rec *ctdb_pull_messaging_rec(TALLOC_CTX *mem_ctx,
|
||||
cluster_fatal("got invalid msg length");
|
||||
}
|
||||
|
||||
if (!(result = TALLOC_P(mem_ctx, struct messaging_rec))) {
|
||||
if (!(result = talloc(mem_ctx, struct messaging_rec))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
@ -433,7 +433,7 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid,
|
||||
goto next_pkt;
|
||||
}
|
||||
|
||||
msg_state = TALLOC_P(NULL, struct deferred_msg_state);
|
||||
msg_state = talloc(NULL, struct deferred_msg_state);
|
||||
if (msg_state == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(hdr);
|
||||
|
@ -1371,7 +1371,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(db_ctdb = TALLOC_P(result, struct db_ctdb_ctx))) {
|
||||
if (!(db_ctdb = talloc(result, struct db_ctdb_ctx))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(result);
|
||||
return NULL;
|
||||
|
@ -80,12 +80,12 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
|
||||
SMB_ASSERT(ctx->locked_record == NULL);
|
||||
|
||||
again:
|
||||
if (!(result = TALLOC_P(mem_ctx, struct db_record))) {
|
||||
if (!(result = talloc(mem_ctx, struct db_record))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(file = TALLOC_P(result, struct db_locked_file))) {
|
||||
if (!(file = talloc(result, struct db_locked_file))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(result);
|
||||
return NULL;
|
||||
@ -353,7 +353,7 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(ctx = TALLOC_P(result, struct db_file_ctx))) {
|
||||
if (!(ctx = talloc(result, struct db_file_ctx))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(result);
|
||||
return NULL;
|
||||
|
@ -347,7 +347,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
result->private_data = db_tdb = TALLOC_P(result, struct db_tdb_ctx);
|
||||
result->private_data = db_tdb = talloc(result, struct db_tdb_ctx);
|
||||
if (db_tdb == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
goto fail;
|
||||
|
@ -105,12 +105,12 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
struct messaging_ctdbd_context *ctx;
|
||||
NTSTATUS status;
|
||||
|
||||
if (!(result = TALLOC_P(mem_ctx, struct messaging_backend))) {
|
||||
if (!(result = talloc(mem_ctx, struct messaging_backend))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
if (!(ctx = TALLOC_P(result, struct messaging_ctdbd_context))) {
|
||||
if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(result);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -87,7 +87,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
|
||||
struct messaging_backend *result;
|
||||
struct messaging_tdb_context *ctx;
|
||||
|
||||
if (!(result = TALLOC_P(mem_ctx, struct messaging_backend))) {
|
||||
if (!(result = talloc(mem_ctx, struct messaging_backend))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
|
||||
case 2:
|
||||
i2 = (struct SHARE_INFO_2 *)buffer;
|
||||
|
||||
s2 = TALLOC_P(mem_ctx, struct srvsvc_NetShareInfo2);
|
||||
s2 = talloc(mem_ctx, struct srvsvc_NetShareInfo2);
|
||||
NT_STATUS_HAVE_NO_MEMORY(s2);
|
||||
|
||||
s2->name = i2->shi2_netname;
|
||||
@ -159,7 +159,7 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
|
||||
case 1004:
|
||||
i1004 = (struct SHARE_INFO_1004 *)buffer;
|
||||
|
||||
s1004 = TALLOC_P(mem_ctx, struct srvsvc_NetShareInfo1004);
|
||||
s1004 = talloc(mem_ctx, struct srvsvc_NetShareInfo1004);
|
||||
NT_STATUS_HAVE_NO_MEMORY(s1004);
|
||||
|
||||
s1004->comment = i1004->shi1004_remark;
|
||||
|
@ -474,7 +474,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
|
||||
return;
|
||||
}
|
||||
|
||||
handle = TALLOC_P(mem_ctx, LDAPMessage *);
|
||||
handle = talloc(mem_ctx, LDAPMessage *);
|
||||
SMB_ASSERT(handle != NULL);
|
||||
|
||||
*handle = result;
|
||||
@ -494,7 +494,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
|
||||
return;
|
||||
}
|
||||
|
||||
handle = TALLOC_P(mem_ctx, LDAPMod **);
|
||||
handle = talloc(mem_ctx, LDAPMod **);
|
||||
SMB_ASSERT(handle != NULL);
|
||||
|
||||
*handle = mod;
|
||||
|
@ -252,7 +252,7 @@ ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
|
||||
return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
}
|
||||
|
||||
if ( (schema = TALLOC_P(mem_ctx, struct posix_schema)) == NULL ) {
|
||||
if ( (schema = talloc(mem_ctx, struct posix_schema)) == NULL ) {
|
||||
TALLOC_FREE( ctx );
|
||||
return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ dos_attr_query(SMBCCTX *context,
|
||||
SMB_INO_T inode = 0;
|
||||
DOS_ATTR_DESC *ret;
|
||||
|
||||
ret = TALLOC_P(ctx, DOS_ATTR_DESC);
|
||||
ret = talloc(ctx, DOS_ATTR_DESC);
|
||||
if (!ret) {
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
|
@ -2479,7 +2479,7 @@ NTSTATUS resolve_name_list(TALLOC_CTX *ctx,
|
||||
*return_ss_arr = NULL;
|
||||
|
||||
if (is_ipaddress(name)) {
|
||||
*return_ss_arr = TALLOC_P(ctx, struct sockaddr_storage);
|
||||
*return_ss_arr = talloc(ctx, struct sockaddr_storage);
|
||||
if (!*return_ss_arr) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
|
||||
|
||||
/* Prepare data */
|
||||
|
||||
if (!(mem_ctx = TALLOC_P( NULL, int))) {
|
||||
if (!(mem_ctx = talloc( NULL, int))) {
|
||||
DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
|
||||
return false;
|
||||
}
|
||||
|
@ -1823,7 +1823,7 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
|
||||
files_struct *fsp, bool read_only)
|
||||
{
|
||||
TDB_DATA key, data;
|
||||
struct byte_range_lock *br_lck = TALLOC_P(mem_ctx, struct byte_range_lock);
|
||||
struct byte_range_lock *br_lck = talloc(mem_ctx, struct byte_range_lock);
|
||||
bool do_read_only = read_only;
|
||||
|
||||
if (br_lck == NULL) {
|
||||
|
@ -973,7 +973,7 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
|
||||
struct file_id tmp;
|
||||
TDB_DATA key = locking_key(&id, &tmp);
|
||||
|
||||
if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
|
||||
if (!(lck = talloc(mem_ctx, struct share_mode_lock))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
@ -1004,7 +1004,7 @@ struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
|
||||
TDB_DATA key = locking_key(&id, &tmp);
|
||||
TDB_DATA data;
|
||||
|
||||
if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
|
||||
if (!(lck = talloc(mem_ctx, struct share_mode_lock))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
@ -1483,7 +1483,7 @@ static struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct
|
||||
{
|
||||
struct security_unix_token *cpy;
|
||||
|
||||
cpy = TALLOC_P(ctx, struct security_unix_token);
|
||||
cpy = talloc(ctx, struct security_unix_token);
|
||||
if (!cpy) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -892,7 +892,7 @@ BECOMES.....
|
||||
| l_curr| | l_new |
|
||||
+-------+ +---------+
|
||||
**********************************************/
|
||||
struct lock_list *l_new = TALLOC_P(ctx, struct lock_list);
|
||||
struct lock_list *l_new = talloc(ctx, struct lock_list);
|
||||
|
||||
if(l_new == NULL) {
|
||||
DEBUG(0,("posix_lock_list: talloc fail.\n"));
|
||||
@ -1000,7 +1000,7 @@ bool set_posix_lock_windows_flavour(files_struct *fsp,
|
||||
return False;
|
||||
}
|
||||
|
||||
if ((ll = TALLOC_P(l_ctx, struct lock_list)) == NULL) {
|
||||
if ((ll = talloc(l_ctx, struct lock_list)) == NULL) {
|
||||
DEBUG(0,("set_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
|
||||
talloc_destroy(l_ctx);
|
||||
return False;
|
||||
@ -1119,7 +1119,7 @@ bool release_posix_lock_windows_flavour(files_struct *fsp,
|
||||
return False;
|
||||
}
|
||||
|
||||
if ((ul = TALLOC_P(ul_ctx, struct lock_list)) == NULL) {
|
||||
if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
|
||||
DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
|
||||
talloc_destroy(ul_ctx);
|
||||
return False;
|
||||
@ -1281,7 +1281,7 @@ bool release_posix_lock_posix_flavour(files_struct *fsp,
|
||||
return False;
|
||||
}
|
||||
|
||||
if ((ul = TALLOC_P(ul_ctx, struct lock_list)) == NULL) {
|
||||
if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
|
||||
DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
|
||||
talloc_destroy(ul_ctx);
|
||||
return False;
|
||||
|
@ -89,7 +89,7 @@ static void free_afs_acl(struct afs_acl *acl)
|
||||
|
||||
static struct afs_ace *clone_afs_ace(TALLOC_CTX *mem_ctx, struct afs_ace *ace)
|
||||
{
|
||||
struct afs_ace *result = TALLOC_P(mem_ctx, struct afs_ace);
|
||||
struct afs_ace *result = talloc(mem_ctx, struct afs_ace);
|
||||
|
||||
if (result == NULL)
|
||||
return NULL;
|
||||
@ -167,7 +167,7 @@ static struct afs_ace *new_afs_ace(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
}
|
||||
|
||||
result = TALLOC_P(mem_ctx, struct afs_ace);
|
||||
result = talloc(mem_ctx, struct afs_ace);
|
||||
|
||||
if (result == NULL) {
|
||||
DEBUG(0, ("Could not talloc AFS ace\n"));
|
||||
|
@ -249,7 +249,7 @@ static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle,
|
||||
fam_connection_initialized = True;
|
||||
}
|
||||
|
||||
if (!(watch = TALLOC_P(ctx, struct fam_watch_context))) {
|
||||
if (!(watch = talloc(ctx, struct fam_watch_context))) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ static SMB_STRUCT_DIR *scannedonly_opendir(vfs_handle_struct * handle,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sDIR = TALLOC_P(NULL, struct scannedonly_DIR);
|
||||
sDIR = talloc(NULL, struct scannedonly_DIR);
|
||||
if (fname[0] != '/') {
|
||||
sDIR->base = construct_full_path(sDIR,handle, fname, true);
|
||||
} else {
|
||||
@ -544,7 +544,7 @@ static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
|
||||
|
||||
fname = (const char *)fsp->fsp_name->base_name;
|
||||
|
||||
sDIR = TALLOC_P(NULL, struct scannedonly_DIR);
|
||||
sDIR = talloc(NULL, struct scannedonly_DIR);
|
||||
if (fname[0] != '/') {
|
||||
sDIR->base = construct_full_path(sDIR,handle, fname, true);
|
||||
} else {
|
||||
|
@ -266,7 +266,7 @@ struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(result = TALLOC_P(mem_ctx, struct share_params))) {
|
||||
if (!(result = talloc(mem_ctx, struct share_params))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum p
|
||||
if (!g_sid)
|
||||
return False;
|
||||
|
||||
if ( !(sampass->group_sid = TALLOC_P( sampass, struct dom_sid )) ) {
|
||||
if ( !(sampass->group_sid = talloc( sampass, struct dom_sid )) ) {
|
||||
return False;
|
||||
}
|
||||
|
||||
|
@ -693,7 +693,7 @@ static NTSTATUS ipasam_enum_trusteddoms(struct pdb_methods *methods,
|
||||
for (i = 0; i < *num_domains; i++) {
|
||||
struct trustdom_info *dom_info;
|
||||
|
||||
dom_info = TALLOC_P(*domains, struct trustdom_info);
|
||||
dom_info = talloc(*domains, struct trustdom_info);
|
||||
if (dom_info == NULL) {
|
||||
DEBUG(1, ("talloc failed\n"));
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -6368,7 +6368,7 @@ static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods,
|
||||
char *dom_name, *dom_sid_str;
|
||||
struct trustdom_info *dom_info;
|
||||
|
||||
dom_info = TALLOC_P(*domains, struct trustdom_info);
|
||||
dom_info = talloc(*domains, struct trustdom_info);
|
||||
if (dom_info == NULL) {
|
||||
DEBUG(1, ("talloc failed\n"));
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -420,7 +420,7 @@ static int list_trusted_domain(struct db_record *rec, void *private_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(dom_info = TALLOC_P(state->domains, struct trustdom_info))) {
|
||||
if (!(dom_info = talloc(state->domains, struct trustdom_info))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ static void send_spoolss_notify2_msg(struct tevent_context *ev,
|
||||
|
||||
/* Store the message on the pending queue. */
|
||||
|
||||
pnqueue = TALLOC_P(send_ctx, struct notify_queue);
|
||||
pnqueue = talloc(send_ctx, struct notify_queue);
|
||||
if (!pnqueue) {
|
||||
DEBUG(0,("send_spoolss_notify2_msg: Out of memory.\n"));
|
||||
return;
|
||||
@ -313,7 +313,7 @@ static void send_spoolss_notify2_msg(struct tevent_context *ev,
|
||||
|
||||
/* allocate a new msg structure and copy the fields */
|
||||
|
||||
if ( !(pnqueue->msg = TALLOC_P(send_ctx, SPOOLSS_NOTIFY_MSG)) ) {
|
||||
if ( !(pnqueue->msg = talloc(send_ctx, SPOOLSS_NOTIFY_MSG)) ) {
|
||||
DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%lu] failed!\n",
|
||||
(unsigned long)sizeof(SPOOLSS_NOTIFY_MSG)));
|
||||
return;
|
||||
@ -357,7 +357,7 @@ static void send_notify_field_values(struct tevent_context *ev,
|
||||
if (!create_send_ctx())
|
||||
return;
|
||||
|
||||
msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
|
||||
msg = talloc(send_ctx, struct spoolss_notify_msg);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
@ -388,7 +388,7 @@ static void send_notify_field_buffer(struct tevent_context *ev,
|
||||
if (!create_send_ctx())
|
||||
return;
|
||||
|
||||
msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
|
||||
msg = talloc(send_ctx, struct spoolss_notify_msg);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
|
@ -524,7 +524,7 @@ bool cups_cache_reload(struct tevent_context *ev,
|
||||
struct cups_async_cb_args *cb_args;
|
||||
int *p_pipe_fd;
|
||||
|
||||
cb_args = TALLOC_P(NULL, struct cups_async_cb_args);
|
||||
cb_args = talloc(NULL, struct cups_async_cb_args);
|
||||
if (cb_args == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
|
||||
uint32_t type,
|
||||
const uint8_t *data_p, size_t size)
|
||||
{
|
||||
struct regval_blob *regval = TALLOC_P(ctx, struct regval_blob);
|
||||
struct regval_blob *regval = talloc(ctx, struct regval_blob);
|
||||
|
||||
if (regval == NULL) {
|
||||
return NULL;
|
||||
@ -505,7 +505,7 @@ int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint32_t type,
|
||||
/* allocate a slot in the array of pointers */
|
||||
|
||||
if ( ctr->num_values == 0 ) {
|
||||
ctr->values = TALLOC_P( ctr, struct regval_blob *);
|
||||
ctr->values = talloc( ctr, struct regval_blob *);
|
||||
} else {
|
||||
ctr->values = talloc_realloc(ctr, ctr->values,
|
||||
struct regval_blob *,
|
||||
|
@ -2412,14 +2412,14 @@ NTSTATUS _lsa_GetUserName(struct pipes_struct *p,
|
||||
domname = p->session_info->info3->base.domain.string;
|
||||
}
|
||||
|
||||
account_name = TALLOC_P(p->mem_ctx, struct lsa_String);
|
||||
account_name = talloc(p->mem_ctx, struct lsa_String);
|
||||
if (!account_name) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
init_lsa_String(account_name, username);
|
||||
|
||||
if (r->out.authority_name) {
|
||||
authority_name = TALLOC_P(p->mem_ctx, struct lsa_String);
|
||||
authority_name = talloc(p->mem_ctx, struct lsa_String);
|
||||
if (!authority_name) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
case 102: {
|
||||
struct srvsvc_NetSrvInfo102 *info102;
|
||||
|
||||
info102 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo102);
|
||||
info102 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo102);
|
||||
if (!info102) {
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -1165,7 +1165,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
case 101: {
|
||||
struct srvsvc_NetSrvInfo101 *info101;
|
||||
|
||||
info101 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo101);
|
||||
info101 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo101);
|
||||
if (!info101) {
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -1184,7 +1184,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
case 100: {
|
||||
struct srvsvc_NetSrvInfo100 *info100;
|
||||
|
||||
info100 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo100);
|
||||
info100 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo100);
|
||||
if (!info100) {
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -1454,47 +1454,47 @@ WERROR _srvsvc_NetShareGetInfo(struct pipes_struct *p,
|
||||
|
||||
switch (r->in.level) {
|
||||
case 0:
|
||||
info->info0 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo0);
|
||||
info->info0 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo0);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info0);
|
||||
init_srv_share_info_0(p, info->info0, snum);
|
||||
break;
|
||||
case 1:
|
||||
info->info1 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1);
|
||||
info->info1 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info1);
|
||||
init_srv_share_info_1(p, info->info1, snum);
|
||||
break;
|
||||
case 2:
|
||||
info->info2 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo2);
|
||||
info->info2 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo2);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info2);
|
||||
init_srv_share_info_2(p, info->info2, snum);
|
||||
break;
|
||||
case 501:
|
||||
info->info501 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo501);
|
||||
info->info501 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo501);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info501);
|
||||
init_srv_share_info_501(p, info->info501, snum);
|
||||
break;
|
||||
case 502:
|
||||
info->info502 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo502);
|
||||
info->info502 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo502);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info502);
|
||||
init_srv_share_info_502(p, info->info502, snum);
|
||||
break;
|
||||
case 1004:
|
||||
info->info1004 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1004);
|
||||
info->info1004 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1004);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info1004);
|
||||
init_srv_share_info_1004(p, info->info1004, snum);
|
||||
break;
|
||||
case 1005:
|
||||
info->info1005 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1005);
|
||||
info->info1005 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1005);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info1005);
|
||||
init_srv_share_info_1005(p, info->info1005, snum);
|
||||
break;
|
||||
case 1006:
|
||||
info->info1006 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1006);
|
||||
info->info1006 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1006);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info1006);
|
||||
init_srv_share_info_1006(p, info->info1006, snum);
|
||||
break;
|
||||
case 1007:
|
||||
info->info1007 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1007);
|
||||
info->info1007 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1007);
|
||||
W_ERROR_HAVE_NO_MEMORY(info->info1007);
|
||||
init_srv_share_info_1007(p, info->info1007, snum);
|
||||
break;
|
||||
|
@ -134,7 +134,7 @@ connection_struct *conn_new(struct smbd_server_connection *sconn)
|
||||
if (sconn->using_smb2) {
|
||||
/* SMB2 */
|
||||
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
|
||||
!(conn->params = TALLOC_P(conn, struct share_params))) {
|
||||
!(conn->params = talloc(conn, struct share_params))) {
|
||||
DEBUG(0,("TALLOC_ZERO() failed!\n"));
|
||||
TALLOC_FREE(conn);
|
||||
return NULL;
|
||||
@ -189,7 +189,7 @@ find_again:
|
||||
}
|
||||
|
||||
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
|
||||
!(conn->params = TALLOC_P(conn, struct share_params))) {
|
||||
!(conn->params = talloc(conn, struct share_params))) {
|
||||
DEBUG(0,("TALLOC_ZERO() failed!\n"));
|
||||
TALLOC_FREE(conn);
|
||||
return NULL;
|
||||
|
@ -207,7 +207,7 @@ uint64_t get_dfree_info(connection_struct *conn,
|
||||
|
||||
/* No cached info or time to refresh. */
|
||||
if (!dfc) {
|
||||
dfc = TALLOC_P(conn, struct dfree_cached_info);
|
||||
dfc = talloc(conn, struct dfree_cached_info);
|
||||
if (!dfc) {
|
||||
return dfree_ret;
|
||||
}
|
||||
|
@ -645,7 +645,7 @@ void reply_trans(struct smb_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
|
||||
if ((state = talloc(conn, struct trans_state)) == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
reply_nterror(req, NT_STATUS_NO_MEMORY);
|
||||
END_PROFILE(SMBtrans);
|
||||
|
@ -692,7 +692,7 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
|
||||
bool *ppath_contains_wcard)
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
|
||||
struct dfs_path *pdp = talloc(ctx, struct dfs_path);
|
||||
|
||||
if (!pdp) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
@ -825,7 +825,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
||||
int snum;
|
||||
NTSTATUS status = NT_STATUS_NOT_FOUND;
|
||||
bool dummy;
|
||||
struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
|
||||
struct dfs_path *pdp = talloc(ctx, struct dfs_path);
|
||||
char *oldpath;
|
||||
|
||||
if (!pdp) {
|
||||
@ -1318,7 +1318,7 @@ bool create_junction(TALLOC_CTX *ctx,
|
||||
{
|
||||
int snum;
|
||||
bool dummy;
|
||||
struct dfs_path *pdp = TALLOC_P(ctx,struct dfs_path);
|
||||
struct dfs_path *pdp = talloc(ctx,struct dfs_path);
|
||||
NTSTATUS status;
|
||||
|
||||
if (!pdp) {
|
||||
|
@ -520,7 +520,7 @@ struct sys_notify_context *sys_notify_context_create(connection_struct *conn,
|
||||
{
|
||||
struct sys_notify_context *ctx;
|
||||
|
||||
if (!(ctx = TALLOC_P(mem_ctx, struct sys_notify_context))) {
|
||||
if (!(ctx = talloc(mem_ctx, struct sys_notify_context))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
@ -3020,7 +3020,7 @@ void reply_nttrans(struct smb_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
|
||||
if ((state = talloc(conn, struct trans_state)) == NULL) {
|
||||
reply_nterror(req, NT_STATUS_NO_MEMORY);
|
||||
END_PROFILE(SMBnttrans);
|
||||
return;
|
||||
|
@ -4750,7 +4750,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(conn->params = TALLOC_P(conn, struct share_params))) {
|
||||
if (!(conn->params = talloc(conn, struct share_params))) {
|
||||
DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n"));
|
||||
TALLOC_FREE(conn);
|
||||
return NULL;
|
||||
|
@ -891,7 +891,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
|
||||
struct idle_event *result;
|
||||
struct timeval now = timeval_current();
|
||||
|
||||
result = TALLOC_P(mem_ctx, struct idle_event);
|
||||
result = talloc(mem_ctx, struct idle_event);
|
||||
if (result == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
|
@ -308,7 +308,7 @@ static NTSTATUS schedule_smb2_sendfile_read(struct smbd_smb2_request *smb2req,
|
||||
/* Make a copy of state attached to the smb2req. Attach
|
||||
the destructor here as this will trigger the sendfile
|
||||
call when the request is destroyed. */
|
||||
state_copy = TALLOC_P(smb2req, struct smbd_smb2_read_state);
|
||||
state_copy = talloc(smb2req, struct smbd_smb2_read_state);
|
||||
if (!state_copy) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str
|
||||
|| samba_private_attr_name(names[i]))
|
||||
continue;
|
||||
|
||||
listp = TALLOC_P(mem_ctx, struct ea_list);
|
||||
listp = talloc(mem_ctx, struct ea_list);
|
||||
if (listp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -8672,7 +8672,7 @@ void reply_trans2(struct smb_request *req)
|
||||
}
|
||||
}
|
||||
|
||||
if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
|
||||
if ((state = talloc(conn, struct trans_state)) == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
reply_nterror(req, NT_STATUS_NO_MEMORY);
|
||||
END_PROFILE(SMBtrans2);
|
||||
|
@ -96,7 +96,7 @@ static struct nbench_cmd_struct *nbench_parse(TALLOC_CTX *mem_ctx,
|
||||
char *cmd;
|
||||
char *status;
|
||||
|
||||
result = TALLOC_P(mem_ctx, struct nbench_cmd_struct);
|
||||
result = talloc(mem_ctx, struct nbench_cmd_struct);
|
||||
if (result == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ int main(int argc, char *argv[])
|
||||
/* some basic initialization stuff */
|
||||
sec_init();
|
||||
vfs.conn = TALLOC_ZERO_P(NULL, connection_struct);
|
||||
vfs.conn->params = TALLOC_P(vfs.conn, struct share_params);
|
||||
vfs.conn->params = talloc(vfs.conn, struct share_params);
|
||||
for (i=0; i < 1024; i++)
|
||||
vfs.files[i] = NULL;
|
||||
|
||||
|
@ -154,7 +154,7 @@ static bool net_sh_process(struct net_context *c,
|
||||
return true;
|
||||
}
|
||||
|
||||
new_ctx = TALLOC_P(ctx, struct rpc_sh_ctx);
|
||||
new_ctx = talloc(ctx, struct rpc_sh_ctx);
|
||||
if (new_ctx == NULL) {
|
||||
d_fprintf(stderr, _("talloc failed\n"));
|
||||
return false;
|
||||
@ -234,7 +234,7 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv)
|
||||
libnetapi_set_use_kerberos(c->netapi_ctx);
|
||||
}
|
||||
|
||||
ctx = TALLOC_P(NULL, struct rpc_sh_ctx);
|
||||
ctx = talloc(NULL, struct rpc_sh_ctx);
|
||||
if (ctx == NULL) {
|
||||
d_fprintf(stderr, _("talloc failed\n"));
|
||||
return -1;
|
||||
|
@ -278,7 +278,7 @@ static int get_share_list(TALLOC_CTX *ctx, const char *wcard, bool only_ours)
|
||||
}
|
||||
|
||||
/* (Finally) - add to list. */
|
||||
fl = TALLOC_P(ctx, struct file_list);
|
||||
fl = talloc(ctx, struct file_list);
|
||||
if (!fl) {
|
||||
sys_closedir(dp);
|
||||
return -1;
|
||||
|
@ -78,7 +78,7 @@ static struct con_struct *create_cs(struct net_context *c,
|
||||
return cs;
|
||||
}
|
||||
|
||||
cs = TALLOC_P(ctx, struct con_struct);
|
||||
cs = talloc(ctx, struct con_struct);
|
||||
if (!cs) {
|
||||
*perr = NT_STATUS_NO_MEMORY;
|
||||
return NULL;
|
||||
|
@ -4527,7 +4527,7 @@ struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const cha
|
||||
DEBUG(10,("wcache_tdc_fetch_domain: Found domain %s\n",
|
||||
name));
|
||||
|
||||
d = TALLOC_P( ctx, struct winbindd_tdc_domain );
|
||||
d = talloc( ctx, struct winbindd_tdc_domain );
|
||||
if ( !d )
|
||||
break;
|
||||
|
||||
@ -4577,7 +4577,7 @@ struct winbindd_tdc_domain*
|
||||
dom_list[i].domain_name,
|
||||
sid_string_dbg(sid)));
|
||||
|
||||
d = TALLOC_P(ctx, struct winbindd_tdc_domain);
|
||||
d = talloc(ctx, struct winbindd_tdc_domain);
|
||||
if (!d)
|
||||
break;
|
||||
|
||||
|
@ -596,7 +596,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
entry = TALLOC_P(NULL, struct WINBINDD_CCACHE_ENTRY);
|
||||
entry = talloc(NULL, struct WINBINDD_CCACHE_ENTRY);
|
||||
if (!entry) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user