Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
47 files changed:
#define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count))
#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
#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)
#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)
- bm = TALLOC_P(mem_ctx, struct bitmap);
+ bm = talloc(mem_ctx, struct bitmap);
cluster_fatal("got invalid msg length");
}
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;
}
DEBUG(0, ("talloc failed\n"));
return NULL;
}
- 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);
if (msg_state == NULL) {
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(hdr);
- 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;
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
return NULL;
SMB_ASSERT(ctx->locked_record == NULL);
again:
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;
}
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;
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
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;
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
return NULL;
- 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;
if (db_tdb == NULL) {
DEBUG(0, ("talloc failed\n"));
goto fail;
struct messaging_ctdbd_context *ctx;
NTSTATUS status;
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;
}
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;
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
struct messaging_backend *result;
struct messaging_tdb_context *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;
}
DEBUG(0, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
}
case 2:
i2 = (struct SHARE_INFO_2 *)buffer;
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;
NT_STATUS_HAVE_NO_MEMORY(s2);
s2->name = i2->shi2_netname;
case 1004:
i1004 = (struct SHARE_INFO_1004 *)buffer;
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;
NT_STATUS_HAVE_NO_MEMORY(s1004);
s1004->comment = i1004->shi1004_remark;
- handle = TALLOC_P(mem_ctx, LDAPMessage *);
+ handle = talloc(mem_ctx, LDAPMessage *);
SMB_ASSERT(handle != NULL);
*handle = result;
SMB_ASSERT(handle != NULL);
*handle = result;
- handle = TALLOC_P(mem_ctx, LDAPMod **);
+ handle = talloc(mem_ctx, LDAPMod **);
SMB_ASSERT(handle != NULL);
*handle = mod;
SMB_ASSERT(handle != NULL);
*handle = mod;
return ADS_ERROR(LDAP_NO_MEMORY);
}
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);
}
TALLOC_FREE( ctx );
return ADS_ERROR(LDAP_NO_MEMORY);
}
SMB_INO_T inode = 0;
DOS_ATTR_DESC *ret;
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;
if (!ret) {
errno = ENOMEM;
return NULL;
*return_ss_arr = NULL;
if (is_ipaddress(name)) {
*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;
}
if (!*return_ss_arr) {
return NT_STATUS_NO_MEMORY;
}
- if (!(mem_ctx = TALLOC_P( NULL, int))) {
+ if (!(mem_ctx = talloc( NULL, int))) {
DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
return false;
}
DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
return false;
}
files_struct *fsp, bool read_only)
{
TDB_DATA key, data;
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) {
bool do_read_only = read_only;
if (br_lck == NULL) {
struct file_id tmp;
TDB_DATA key = locking_key(&id, &tmp);
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;
}
DEBUG(0, ("talloc failed\n"));
return NULL;
}
TDB_DATA key = locking_key(&id, &tmp);
TDB_DATA data;
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;
}
DEBUG(0, ("talloc failed\n"));
return NULL;
}
{
struct security_unix_token *cpy;
{
struct security_unix_token *cpy;
- cpy = TALLOC_P(ctx, struct security_unix_token);
+ cpy = talloc(ctx, struct security_unix_token);
if (!cpy) {
return NULL;
}
if (!cpy) {
return NULL;
}
| l_curr| | l_new |
+-------+ +---------+
**********************************************/
| 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"));
if(l_new == NULL) {
DEBUG(0,("posix_lock_list: talloc fail.\n"));
- 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;
DEBUG(0,("set_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
talloc_destroy(l_ctx);
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;
DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
talloc_destroy(ul_ctx);
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;
DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
talloc_destroy(ul_ctx);
return False;
static struct afs_ace *clone_afs_ace(TALLOC_CTX *mem_ctx, struct afs_ace *ace)
{
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;
if (result == NULL)
return NULL;
- 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"));
if (result == NULL) {
DEBUG(0, ("Could not talloc AFS ace\n"));
fam_connection_initialized = True;
}
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;
}
return NT_STATUS_NO_MEMORY;
}
- 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 {
if (fname[0] != '/') {
sDIR->base = construct_full_path(sDIR,handle, fname, true);
} else {
fname = (const char *)fsp->fsp_name->base_name;
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 {
if (fname[0] != '/') {
sDIR->base = construct_full_path(sDIR,handle, fname, true);
} else {
- if (!(result = TALLOC_P(mem_ctx, struct share_params))) {
+ if (!(result = talloc(mem_ctx, struct share_params))) {
DEBUG(0, ("talloc failed\n"));
return NULL;
}
DEBUG(0, ("talloc failed\n"));
return NULL;
}
if (!g_sid)
return False;
if (!g_sid)
return False;
- if ( !(sampass->group_sid = TALLOC_P( sampass, struct dom_sid )) ) {
+ if ( !(sampass->group_sid = talloc( sampass, struct dom_sid )) ) {
for (i = 0; i < *num_domains; i++) {
struct trustdom_info *dom_info;
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;
if (dom_info == NULL) {
DEBUG(1, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
char *dom_name, *dom_sid_str;
struct trustdom_info *dom_info;
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;
if (dom_info == NULL) {
DEBUG(1, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
- 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;
}
DEBUG(0, ("talloc failed\n"));
return 0;
}
/* Store the message on the pending queue. */
/* 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;
if (!pnqueue) {
DEBUG(0,("send_spoolss_notify2_msg: Out of memory.\n"));
return;
/* allocate a new msg structure and copy the fields */
/* 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;
DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%lu] failed!\n",
(unsigned long)sizeof(SPOOLSS_NOTIFY_MSG)));
return;
if (!create_send_ctx())
return;
if (!create_send_ctx())
return;
- msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
+ msg = talloc(send_ctx, struct spoolss_notify_msg);
if (!create_send_ctx())
return;
if (!create_send_ctx())
return;
- msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
+ msg = talloc(send_ctx, struct spoolss_notify_msg);
struct cups_async_cb_args *cb_args;
int *p_pipe_fd;
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;
}
if (cb_args == NULL) {
return false;
}
uint32_t type,
const uint8_t *data_p, size_t size)
{
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;
if (regval == NULL) {
return NULL;
/* allocate a slot in the array of pointers */
if ( ctr->num_values == 0 ) {
/* 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 *,
} else {
ctr->values = talloc_realloc(ctr, ctr->values,
struct regval_blob *,
domname = p->session_info->info3->base.domain.string;
}
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) {
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;
}
if (!authority_name) {
return NT_STATUS_NO_MEMORY;
}
case 102: {
struct srvsvc_NetSrvInfo102 *info102;
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;
}
if (!info102) {
return WERR_NOMEM;
}
case 101: {
struct srvsvc_NetSrvInfo101 *info101;
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;
}
if (!info101) {
return WERR_NOMEM;
}
case 100: {
struct srvsvc_NetSrvInfo100 *info100;
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;
}
if (!info100) {
return WERR_NOMEM;
}
switch (r->in.level) {
case 0:
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:
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:
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:
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:
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:
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:
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:
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:
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;
W_ERROR_HAVE_NO_MEMORY(info->info1007);
init_srv_share_info_1007(p, info->info1007, snum);
break;
if (sconn->using_smb2) {
/* SMB2 */
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
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;
DEBUG(0,("TALLOC_ZERO() failed!\n"));
TALLOC_FREE(conn);
return NULL;
}
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
}
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;
DEBUG(0,("TALLOC_ZERO() failed!\n"));
TALLOC_FREE(conn);
return NULL;
/* No cached info or time to refresh. */
if (!dfc) {
/* 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;
}
if (!dfc) {
return dfree_ret;
}
- 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);
DEBUG(0, ("talloc failed\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
END_PROFILE(SMBtrans);
bool *ppath_contains_wcard)
{
NTSTATUS status;
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;
if (!pdp) {
return NT_STATUS_NO_MEMORY;
int snum;
NTSTATUS status = NT_STATUS_NOT_FOUND;
bool dummy;
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) {
char *oldpath;
if (!pdp) {
- struct dfs_path *pdp = TALLOC_P(ctx,struct dfs_path);
+ struct dfs_path *pdp = talloc(ctx,struct dfs_path);
NTSTATUS status;
if (!pdp) {
NTSTATUS status;
if (!pdp) {
{
struct sys_notify_context *ctx;
{
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;
}
DEBUG(0, ("talloc failed\n"));
return NULL;
}
- 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;
reply_nterror(req, NT_STATUS_NO_MEMORY);
END_PROFILE(SMBnttrans);
return;
- 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;
DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n"));
TALLOC_FREE(conn);
return NULL;
struct idle_event *result;
struct timeval now = timeval_current();
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;
if (result == NULL) {
DEBUG(0, ("talloc failed\n"));
return NULL;
/* 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. */
/* 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;
}
if (!state_copy) {
return NT_STATUS_NO_MEMORY;
}
|| samba_private_attr_name(names[i]))
continue;
|| 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;
}
if (listp == NULL) {
return NULL;
}
- 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);
DEBUG(0, ("talloc failed\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
END_PROFILE(SMBtrans2);
- result = TALLOC_P(mem_ctx, struct nbench_cmd_struct);
+ result = talloc(mem_ctx, struct nbench_cmd_struct);
if (result == NULL) {
return NULL;
}
if (result == NULL) {
return NULL;
}
/* some basic initialization stuff */
sec_init();
vfs.conn = TALLOC_ZERO_P(NULL, connection_struct);
/* 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;
for (i=0; i < 1024; i++)
vfs.files[i] = NULL;
- 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;
if (new_ctx == NULL) {
d_fprintf(stderr, _("talloc failed\n"));
return false;
libnetapi_set_use_kerberos(c->netapi_ctx);
}
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;
if (ctx == NULL) {
d_fprintf(stderr, _("talloc failed\n"));
return -1;
}
/* (Finally) - add to list. */
}
/* (Finally) - add to list. */
- fl = TALLOC_P(ctx, struct file_list);
+ fl = talloc(ctx, struct file_list);
if (!fl) {
sys_closedir(dp);
return -1;
if (!fl) {
sys_closedir(dp);
return -1;
- cs = TALLOC_P(ctx, struct con_struct);
+ cs = talloc(ctx, struct con_struct);
if (!cs) {
*perr = NT_STATUS_NO_MEMORY;
return NULL;
if (!cs) {
*perr = NT_STATUS_NO_MEMORY;
return NULL;
DEBUG(10,("wcache_tdc_fetch_domain: Found domain %s\n",
name));
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 );
dom_list[i].domain_name,
sid_string_dbg(sid)));
dom_list[i].domain_name,
sid_string_dbg(sid)));
- d = TALLOC_P(ctx, struct winbindd_tdc_domain);
+ d = talloc(ctx, struct winbindd_tdc_domain);
- entry = TALLOC_P(NULL, struct WINBINDD_CCACHE_ENTRY);
+ entry = talloc(NULL, struct WINBINDD_CCACHE_ENTRY);
if (!entry) {
return NT_STATUS_NO_MEMORY;
}
if (!entry) {
return NT_STATUS_NO_MEMORY;
}