1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3-talloc Change TALLOC_ZERO_P() to talloc_zero()

Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
This commit is contained in:
Andrew Bartlett 2011-06-07 11:44:43 +10:00
parent d5e6a47f06
commit ad0a07c531
114 changed files with 228 additions and 229 deletions

View File

@ -390,7 +390,7 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
uint16 i;
DNS_ERROR err;
if (!(req = TALLOC_ZERO_P(mem_ctx, struct dns_request))) {
if (!(req = talloc_zero(mem_ctx, struct dns_request))) {
return ERROR_DNS_NO_MEMORY;
}

View File

@ -31,7 +31,7 @@ DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name,
struct dns_question *q;
DNS_ERROR err;
if (!(req = TALLOC_ZERO_P(mem_ctx, struct dns_request)) ||
if (!(req = talloc_zero(mem_ctx, struct dns_request)) ||
!(req->questions = talloc_array(req, struct dns_question *, 1)) ||
!(req->questions[0] = talloc(req->questions,
struct dns_question))) {
@ -64,7 +64,7 @@ DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
struct dns_zone *z;
DNS_ERROR err;
if (!(req = TALLOC_ZERO_P(mem_ctx, struct dns_update_request)) ||
if (!(req = talloc_zero(mem_ctx, struct dns_update_request)) ||
!(req->zones = talloc_array(req, struct dns_zone *, 1)) ||
!(req->zones[0] = talloc(req->zones, struct dns_zone))) {
TALLOC_FREE(req);

View File

@ -250,7 +250,7 @@ static DNS_ERROR dns_receive_tcp(TALLOC_CTX *mem_ctx,
DNS_ERROR err;
uint16 len;
if (!(buf = TALLOC_ZERO_P(mem_ctx, struct dns_buffer))) {
if (!(buf = talloc_zero(mem_ctx, struct dns_buffer))) {
return ERROR_DNS_NO_MEMORY;
}
@ -287,7 +287,7 @@ static DNS_ERROR dns_receive_udp(TALLOC_CTX *mem_ctx,
struct dns_buffer *buf;
ssize_t received;
if (!(buf = TALLOC_ZERO_P(mem_ctx, struct dns_buffer))) {
if (!(buf = talloc_zero(mem_ctx, struct dns_buffer))) {
return ERROR_DNS_NO_MEMORY;
}

View File

@ -53,7 +53,7 @@ static DNS_ERROR LabelList( TALLOC_CTX *mem_ctx,
return ERROR_DNS_INVALID_NAME;
}
if (!(result = TALLOC_ZERO_P(mem_ctx, struct dns_domain_label))) {
if (!(result = talloc_zero(mem_ctx, struct dns_domain_label))) {
return ERROR_DNS_NO_MEMORY;
}

View File

@ -351,7 +351,7 @@ NTSTATUS gp_ext_info_add_entry(TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct gp_extension_reg_info_entry *entry = NULL;
entry = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info_entry);
entry = talloc_zero(mem_ctx, struct gp_extension_reg_info_entry);
NT_STATUS_HAVE_NO_MEMORY(entry);
status = GUID_from_string(ext_guid, &entry->guid);

View File

@ -582,7 +582,7 @@ static ADS_STATUS add_gplink_to_gpo_list(ADS_STRUCT *ads,
}
}
new_gpo = TALLOC_ZERO_P(mem_ctx, struct GROUP_POLICY_OBJECT);
new_gpo = talloc_zero(mem_ctx, struct GROUP_POLICY_OBJECT);
ADS_ERROR_HAVE_NO_MEMORY(new_gpo);
status = ads_get_gpo(ads, mem_ctx, gp_link->link_names[i],
@ -688,7 +688,7 @@ static ADS_STATUS add_local_policy_to_gpo_list(TALLOC_CTX *mem_ctx,
ADS_ERROR_HAVE_NO_MEMORY(gpo_list);
gpo = TALLOC_ZERO_P(mem_ctx, struct GROUP_POLICY_OBJECT);
gpo = talloc_zero(mem_ctx, struct GROUP_POLICY_OBJECT);
ADS_ERROR_HAVE_NO_MEMORY(gpo);
gpo->name = talloc_strdup(mem_ctx, "Local Policy");

View File

@ -536,7 +536,7 @@ static int _pam_winbind_init_context(pam_handle_t *pamh,
textdomain_init();
#endif
r = TALLOC_ZERO_P(NULL, struct pwb_context);
r = talloc_zero(NULL, struct pwb_context);
if (!r) {
return PAM_BUF_ERR;
}

View File

@ -57,7 +57,7 @@ static NTSTATUS auth_init_guest(struct auth_context *auth_context, const char *o
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -117,7 +117,7 @@ static NTSTATUS auth_init_name_to_ntstatus(struct auth_context *auth_context, co
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -171,7 +171,7 @@ static NTSTATUS auth_init_fixed_challenge(struct auth_context *auth_context, con
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -419,7 +419,7 @@ static NTSTATUS auth_init_ntdomain(struct auth_context *auth_context, const char
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -525,7 +525,7 @@ static NTSTATUS auth_init_trustdomain(struct auth_context *auth_context, const c
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -429,7 +429,7 @@ static NTSTATUS auth_init_netlogond(struct auth_context *auth_context,
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -44,7 +44,7 @@ static NTSTATUS auth_init_sam_ignoredomain(struct auth_context *auth_context, co
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -108,7 +108,7 @@ static NTSTATUS auth_init_sam(struct auth_context *auth_context, const char *par
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -99,7 +99,7 @@ static NTSTATUS auth_init_samba4(struct auth_context *auth_context,
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -124,7 +124,7 @@ static NTSTATUS auth_init_script(struct auth_context *auth_context, const char *
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -452,7 +452,7 @@ static NTSTATUS auth_init_smbserver(struct auth_context *auth_context, const cha
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -73,7 +73,7 @@ static NTSTATUS auth_init_unix(struct auth_context *auth_context, const char* pa
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -182,7 +182,7 @@ static NTSTATUS auth_init_wbc(struct auth_context *auth_context, const char *par
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -142,7 +142,7 @@ static NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char
{
struct auth_methods *result;
result = TALLOC_ZERO_P(auth_context, struct auth_methods);
result = talloc_zero(auth_context, struct auth_methods);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -531,7 +531,7 @@ NTSTATUS check_sam_security_info3(const DATA_BLOB *challenge,
goto done;
}
info3 = TALLOC_ZERO_P(mem_ctx, struct netr_SamInfo3);
info3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
if (info3 == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;

View File

@ -45,7 +45,7 @@ struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx)
{
struct auth_serversupplied_info *result;
result = TALLOC_ZERO_P(mem_ctx, struct auth_serversupplied_info);
result = talloc_zero(mem_ctx, struct auth_serversupplied_info);
if (result == NULL) {
DEBUG(0, ("talloc failed\n"));
return NULL;

View File

@ -338,7 +338,7 @@ struct security_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
DEBUG(10, ("Create local NT token for %s\n",
sid_string_dbg(user_sid)));
if (!(result = TALLOC_ZERO_P(mem_ctx, struct security_token))) {
if (!(result = talloc_zero(mem_ctx, struct security_token))) {
DEBUG(0, ("talloc failed\n"));
return NULL;
}

View File

@ -221,7 +221,6 @@ copy an IP address from one buffer to another
#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
#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_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
#define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__)
#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)

View File

@ -44,7 +44,7 @@ struct ctdb_packet_context *ctdb_packet_init(TALLOC_CTX *mem_ctx, int fd)
{
struct ctdb_packet_context *result;
if (!(result = TALLOC_ZERO_P(mem_ctx, struct ctdb_packet_context))) {
if (!(result = talloc_zero(mem_ctx, struct ctdb_packet_context))) {
return NULL;
}

View File

@ -494,7 +494,7 @@ static NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx,
struct ctdbd_connection *conn;
NTSTATUS status;
if (!(conn = TALLOC_ZERO_P(mem_ctx, struct ctdbd_connection))) {
if (!(conn = talloc_zero(mem_ctx, struct ctdbd_connection))) {
DEBUG(0, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
}

View File

@ -1025,7 +1025,7 @@ static struct db_record *fetch_locked_internal(struct db_ctdb_ctx *ctx,
return NULL;
}
if (!(crec = TALLOC_ZERO_P(result, struct db_ctdb_rec))) {
if (!(crec = talloc_zero(result, struct db_ctdb_rec))) {
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
return NULL;
@ -1365,7 +1365,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
return NULL;
}
if (!(result = TALLOC_ZERO_P(mem_ctx, struct db_context))) {
if (!(result = talloc_zero(mem_ctx, struct db_context))) {
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
return NULL;

View File

@ -348,7 +348,7 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx,
struct db_context *result = NULL;
struct db_file_ctx *ctx;
if (!(result = TALLOC_ZERO_P(mem_ctx, struct db_context))) {
if (!(result = talloc_zero(mem_ctx, struct db_context))) {
DEBUG(0, ("talloc failed\n"));
return NULL;
}

View File

@ -400,7 +400,7 @@ struct db_context *db_open_rbt(TALLOC_CTX *mem_ctx)
return NULL;
}
result->private_data = TALLOC_ZERO_P(result, struct db_rbt_ctx);
result->private_data = talloc_zero(result, struct db_rbt_ctx);
if (result->private_data == NULL) {
TALLOC_FREE(result);

View File

@ -341,7 +341,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
struct db_context *result = NULL;
struct db_tdb_ctx *db_tdb;
result = TALLOC_ZERO_P(mem_ctx, struct db_context);
result = talloc_zero(mem_ctx, struct db_context);
if (result == NULL) {
DEBUG(0, ("talloc failed\n"));
goto fail;

View File

@ -416,7 +416,7 @@ ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only )
return ptr;
}
if ( !(tdb_node = TALLOC_ZERO_P( NULL, ELOG_TDB)) ) {
if ( !(tdb_node = talloc_zero( NULL, ELOG_TDB)) ) {
DEBUG(0,("elog_open_tdb: talloc() failure!\n"));
tdb_close( tdb );
return NULL;

View File

@ -42,7 +42,7 @@ static struct tevent_poll_private *tevent_get_poll_private(
state = (struct tevent_poll_private *)ev->additional_data;
if (state == NULL) {
state = TALLOC_ZERO_P(ev, struct tevent_poll_private);
state = talloc_zero(ev, struct tevent_poll_private);
ev->additional_data = (void *)state;
if (state == NULL) {
DEBUG(10, ("talloc failed\n"));

View File

@ -72,7 +72,7 @@ struct memcache *memcache_init(TALLOC_CTX *mem_ctx, size_t max_size)
{
struct memcache *result;
result = TALLOC_ZERO_P(mem_ctx, struct memcache);
result = talloc_zero(mem_ctx, struct memcache);
if (result == NULL) {
return NULL;
}

View File

@ -184,7 +184,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
struct messaging_context *ctx;
NTSTATUS status;
if (!(ctx = TALLOC_ZERO_P(mem_ctx, struct messaging_context))) {
if (!(ctx = talloc_zero(mem_ctx, struct messaging_context))) {
return NULL;
}

View File

@ -92,7 +92,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
return NT_STATUS_NO_MEMORY;
}
ctx = TALLOC_ZERO_P(result, struct messaging_tdb_context);
ctx = talloc_zero(result, struct messaging_tdb_context);
if (!ctx) {
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(result);
@ -187,7 +187,7 @@ static NTSTATUS messaging_tdb_fetch(TDB_CONTEXT *msg_tdb,
DATA_BLOB blob;
enum ndr_err_code ndr_err;
if (!(result = TALLOC_ZERO_P(mem_ctx, struct messaging_array))) {
if (!(result = talloc_zero(mem_ctx, struct messaging_array))) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -122,7 +122,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
return WERR_CAN_NOT_COMPLETE;
}
p = TALLOC_ZERO_P(ctx, struct client_ipc_connection);
p = talloc_zero(ctx, struct client_ipc_connection);
if (p == NULL) {
return WERR_NOMEM;
}

View File

@ -610,7 +610,7 @@ static WERROR map_buffer_to_alias_info(TALLOC_CTX *mem_ctx,
struct LOCALGROUP_INFO_1002 *info1002;
union samr_AliasInfo *info = NULL;
info = TALLOC_ZERO_P(mem_ctx, union samr_AliasInfo);
info = talloc_zero(mem_ctx, union samr_AliasInfo);
W_ERROR_HAVE_NO_MEMORY(info);
switch (level) {

View File

@ -37,7 +37,7 @@ static NET_API_STATUS libnetapi_init_private_context(struct libnetapi_ctx *ctx)
return W_ERROR_V(WERR_INVALID_PARAM);
}
priv = TALLOC_ZERO_P(ctx, struct libnetapi_private_ctx);
priv = talloc_zero(ctx, struct libnetapi_private_ctx);
if (!priv) {
return W_ERROR_V(WERR_NOMEM);
}

View File

@ -259,7 +259,7 @@ static sbcErr smbconf_reg_set_multi_sz_value(struct registry_key *key,
goto done;
}
value = TALLOC_ZERO_P(tmp_ctx, struct registry_value);
value = talloc_zero(tmp_ctx, struct registry_value);
if (value == NULL) {
err = SBC_ERR_NOMEM;
goto done;
@ -604,7 +604,7 @@ static sbcErr smbconf_reg_init(struct smbconf_ctx *ctx, const char *path)
goto done;
}
ctx->data = TALLOC_ZERO_P(ctx, struct reg_private_data);
ctx->data = talloc_zero(ctx, struct reg_private_data);
werr = ntstatus_to_werror(registry_create_admin_token(ctx, &token));
if (!W_ERROR_IS_OK(werr)) {
@ -913,7 +913,7 @@ static sbcErr smbconf_reg_get_share(struct smbconf_ctx *ctx,
goto done;
}
tmp_service = TALLOC_ZERO_P(tmp_ctx, struct smbconf_service);
tmp_service = talloc_zero(tmp_ctx, struct smbconf_service);
if (tmp_service == NULL) {
err = SBC_ERR_NOMEM;
goto done;

View File

@ -1862,7 +1862,7 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx,
const char *location,
struct smbldap_state **smbldap_state)
{
*smbldap_state = TALLOC_ZERO_P(mem_ctx, struct smbldap_state);
*smbldap_state = talloc_zero(mem_ctx, struct smbldap_state);
if (!*smbldap_state) {
DEBUG(0, ("talloc() failed for ldapsam private_data!\n"));
return NT_STATUS_NO_MEMORY;

View File

@ -34,7 +34,7 @@ struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx)
{
struct user_auth_info *result;
result = TALLOC_ZERO_P(mem_ctx, struct user_auth_info);
result = talloc_zero(mem_ctx, struct user_auth_info);
if (result == NULL) {
return NULL;
}

View File

@ -39,7 +39,7 @@ struct security_token *dup_nt_token(TALLOC_CTX *mem_ctx, const struct security_t
if (!ptoken)
return NULL;
token = TALLOC_ZERO_P(mem_ctx, struct security_token);
token = talloc_zero(mem_ctx, struct security_token);
if (token == NULL) {
DEBUG(0, ("talloc failed\n"));
return NULL;
@ -80,7 +80,7 @@ NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
token = TALLOC_ZERO_P(mem_ctx, struct security_token);
token = talloc_zero(mem_ctx, struct security_token);
NT_STATUS_HAVE_NO_MEMORY(token);
for (i=0; i < token_1->num_sids; i++) {

View File

@ -784,7 +784,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;
@ -1431,7 +1431,7 @@ static ADS_STATUS ads_modlist_add(TALLOC_CTX *ctx, ADS_MODLIST *mods,
*mods = (ADS_MODLIST)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) {

View File

@ -111,14 +111,14 @@ static bool gp_reg_entry_from_file_entry(TALLOC_CTX *mem_ctx,
ZERO_STRUCTP(*reg_entry);
data = TALLOC_ZERO_P(mem_ctx, struct registry_value);
data = talloc_zero(mem_ctx, struct registry_value);
if (!data)
return false;
data->type = r->type;
data->data = data_blob_talloc(data, r->data, r->size);
entry = TALLOC_ZERO_P(mem_ctx, struct gp_registry_entry);
entry = talloc_zero(mem_ctx, struct gp_registry_entry);
if (!entry)
return false;
@ -327,7 +327,7 @@ static NTSTATUS registry_get_reg_config(TALLOC_CTX *mem_ctx,
{ NULL, REG_NONE, NULL }
};
info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info);
info = talloc_zero(mem_ctx, struct gp_extension_reg_info);
NT_STATUS_HAVE_NO_MEMORY(info);
status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME,

View File

@ -62,7 +62,7 @@ static NTSTATUS scripts_get_reg_config(TALLOC_CTX *mem_ctx,
{ NULL, REG_NONE, NULL },
};
info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info);
info = talloc_zero(mem_ctx, struct gp_extension_reg_info);
NT_STATUS_HAVE_NO_MEMORY(info);
status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME,
@ -89,10 +89,10 @@ static NTSTATUS generate_gp_registry_entry(TALLOC_CTX *mem_ctx,
struct gp_registry_entry *entry = NULL;
struct registry_value *data = NULL;
entry = TALLOC_ZERO_P(mem_ctx, struct gp_registry_entry);
entry = talloc_zero(mem_ctx, struct gp_registry_entry);
NT_STATUS_HAVE_NO_MEMORY(entry);
data = TALLOC_ZERO_P(mem_ctx, struct registry_value);
data = talloc_zero(mem_ctx, struct registry_value);
NT_STATUS_HAVE_NO_MEMORY(data);
data->type = data_type;

View File

@ -202,7 +202,7 @@ static NTSTATUS security_get_reg_config(TALLOC_CTX *mem_ctx,
{ NULL, REG_NONE, NULL }
};
info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info);
info = talloc_zero(mem_ctx, struct gp_extension_reg_info);
NT_STATUS_HAVE_NO_MEMORY(info);
status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME,

View File

@ -36,7 +36,7 @@ struct security_token *registry_create_system_token(TALLOC_CTX *mem_ctx)
{
struct security_token *token = NULL;
token = TALLOC_ZERO_P(mem_ctx, struct security_token);
token = talloc_zero(mem_ctx, struct security_token);
if (!token) {
DEBUG(1,("talloc failed\n"));
return NULL;
@ -74,7 +74,7 @@ WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx,
return werr;
}
tmp_ctx = TALLOC_ZERO_P(mem_ctx, struct gp_registry_context);
tmp_ctx = talloc_zero(mem_ctx, struct gp_registry_context);
W_ERROR_HAVE_NO_MEMORY(tmp_ctx);
if (token) {
@ -395,7 +395,7 @@ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx,
int num_token_sids = 0;
struct security_token *tmp_token = NULL;
tmp_token = TALLOC_ZERO_P(mem_ctx, struct security_token);
tmp_token = talloc_zero(mem_ctx, struct security_token);
W_ERROR_HAVE_NO_MEMORY(tmp_token);
path = gp_reg_groupmembership_path(mem_ctx, object_sid, flags);
@ -602,7 +602,7 @@ static WERROR gp_read_reg_gpo(TALLOC_CTX *mem_ctx,
return WERR_INVALID_PARAM;
}
gpo = TALLOC_ZERO_P(mem_ctx, struct GROUP_POLICY_OBJECT);
gpo = talloc_zero(mem_ctx, struct GROUP_POLICY_OBJECT);
W_ERROR_HAVE_NO_MEMORY(gpo);
werr = gp_read_reg_gpovals(mem_ctx, key, gpo);

View File

@ -54,7 +54,7 @@ NTSTATUS libnet_dssync_init_context(TALLOC_CTX *mem_ctx,
{
struct dssync_context *ctx;
ctx = TALLOC_ZERO_P(mem_ctx, struct dssync_context);
ctx = talloc_zero(mem_ctx, struct dssync_context);
NT_STATUS_HAVE_NO_MEMORY(ctx);
talloc_set_destructor(ctx, libnet_dssync_free_context);
@ -339,7 +339,7 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx,
level = 5;
}
nc = TALLOC_ZERO_P(mem_ctx, struct drsuapi_DsReplicaObjectIdentifier);
nc = talloc_zero(mem_ctx, struct drsuapi_DsReplicaObjectIdentifier);
if (!nc) {
status = NT_STATUS_NO_MEMORY;
goto fail;
@ -351,7 +351,7 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx,
if (!ctx->single_object_replication &&
!ctx->force_full_replication && utdv)
{
cursors = TALLOC_ZERO_P(mem_ctx,
cursors = talloc_zero(mem_ctx,
struct drsuapi_DsReplicaCursorCtrEx);
if (!cursors) {
status = NT_STATUS_NO_MEMORY;
@ -442,7 +442,7 @@ static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx,
struct dcerpc_binding_handle *b = ctx->cli->binding_handle;
if (!ctx->single_object_replication) {
new_utdv = TALLOC_ZERO_P(mem_ctx, struct replUpToDateVectorBlob);
new_utdv = talloc_zero(mem_ctx, struct replUpToDateVectorBlob);
if (!new_utdv) {
status = NT_STATUS_NO_MEMORY;
goto out;

View File

@ -200,7 +200,7 @@ static NTSTATUS parse_supplemental_credentials(TALLOC_CTX *mem_ctx,
goto done;
}
pkb = TALLOC_ZERO_P(mem_ctx, struct package_PrimaryKerberosBlob);
pkb = talloc_zero(mem_ctx, struct package_PrimaryKerberosBlob);
if (!pkb) {
status = NT_STATUS_NO_MEMORY;
goto done;

View File

@ -66,7 +66,7 @@ krb5_error_code libnet_keytab_init(TALLOC_CTX *mem_ctx,
struct libnet_keytab_context *r;
r = TALLOC_ZERO_P(mem_ctx, struct libnet_keytab_context);
r = talloc_zero(mem_ctx, struct libnet_keytab_context);
if (!r) {
return ENOMEM;
}

View File

@ -70,7 +70,7 @@ NTSTATUS libnet_samsync_init_context(TALLOC_CTX *mem_ctx,
*ctx_p = NULL;
ctx = TALLOC_ZERO_P(mem_ctx, struct samsync_context);
ctx = talloc_zero(mem_ctx, struct samsync_context);
NT_STATUS_HAVE_NO_MEMORY(ctx);
if (domain_sid) {
@ -404,7 +404,7 @@ NTSTATUS pull_netr_AcctLockStr(TALLOC_CTX *mem_ctx,
*str_p = NULL;
str = TALLOC_ZERO_P(mem_ctx, struct netr_AcctLockStr);
str = talloc_zero(mem_ctx, struct netr_AcctLockStr);
if (!str) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -946,7 +946,7 @@ static NTSTATUS ldif_init_context(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
r = TALLOC_ZERO_P(mem_ctx, struct samsync_ldif_context);
r = talloc_zero(mem_ctx, struct samsync_ldif_context);
NT_STATUS_HAVE_NO_MEMORY(r);
/* Get the ldap suffix */

View File

@ -227,7 +227,7 @@ static bool parse_getdc_response(
blob = p.smb.body.trans.data;
r = TALLOC_ZERO_P(mem_ctx, struct netlogon_samlogon_response);
r = talloc_zero(mem_ctx, struct netlogon_samlogon_response);
if (!r) {
return false;
}

View File

@ -213,7 +213,7 @@ struct cli_state *cli_initialise_ex(int signing_state)
return NULL;
}
cli = TALLOC_ZERO_P(NULL, struct cli_state);
cli = talloc_zero(NULL, struct cli_state);
if (!cli) {
return NULL;
}

View File

@ -269,13 +269,13 @@ NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
goto cleanup;
}
if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
if ((tmp_list_ent=talloc_zero(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
talloc_destroy(mem_ctx);
return NT_STATUS_NO_MEMORY;
}
if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
if ((tmp_list_ent->quotas=talloc_zero(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
talloc_destroy(mem_ctx);
return NT_STATUS_NO_MEMORY;
@ -326,13 +326,13 @@ NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
goto cleanup;
}
if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
if ((tmp_list_ent=talloc_zero(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
talloc_destroy(mem_ctx);
goto cleanup;
}
if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
if ((tmp_list_ent->quotas=talloc_zero(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
talloc_destroy(mem_ctx);
goto cleanup;

View File

@ -339,7 +339,7 @@ static NTSTATUS dsgetdcname_cache_fetch(TALLOC_CTX *mem_ctx,
return NT_STATUS_NOT_FOUND;
}
info = TALLOC_ZERO_P(mem_ctx, struct netr_DsRGetDCNameInfo);
info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo);
if (!info) {
return NT_STATUS_NO_MEMORY;
}
@ -659,7 +659,7 @@ static NTSTATUS make_domain_controller_info(TALLOC_CTX *mem_ctx,
{
struct netr_DsRGetDCNameInfo *info;
info = TALLOC_ZERO_P(mem_ctx, struct netr_DsRGetDCNameInfo);
info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo);
NT_STATUS_HAVE_NO_MEMORY(info);
if (dc_unc) {
@ -963,7 +963,7 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
{
struct NETLOGON_SAM_LOGON_RESPONSE_NT40 logon1;
r = TALLOC_ZERO_P(mem_ctx, struct netlogon_samlogon_response);
r = talloc_zero(mem_ctx, struct netlogon_samlogon_response);
NT_STATUS_HAVE_NO_MEMORY(r);
ZERO_STRUCT(logon1);

View File

@ -217,7 +217,7 @@ struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct do
return NULL;
}
info3 = TALLOC_ZERO_P(mem_ctx, struct netr_SamInfo3);
info3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
if (!info3) {
goto done;
}

View File

@ -73,7 +73,7 @@ NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
struct tevent_fd *fde;
NTSTATUS status;
result = TALLOC_ZERO_P(mem_ctx, struct nb_packet_server);
result = talloc_zero(mem_ctx, struct nb_packet_server);
if (result == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
@ -140,7 +140,7 @@ static void nb_packet_server_listener(struct tevent_context *ev,
}
DEBUG(6,("accepted socket %d\n", sock));
client = TALLOC_ZERO_P(server, struct nb_packet_client);
client = talloc_zero(server, struct nb_packet_client);
if (client == NULL) {
DEBUG(10, ("talloc failed\n"));
close(sock);
@ -378,7 +378,7 @@ static void nb_packet_client_send(struct nb_packet_client *client,
return;
}
state = TALLOC_ZERO_P(client, struct nb_packet_client_state);
state = talloc_zero(client, struct nb_packet_client_state);
if (state == NULL) {
DEBUG(10, ("talloc failed\n"));
return;
@ -485,7 +485,7 @@ struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
state->query.mailslot_namelen = strlen(mailslot_name);
}
state->reader = TALLOC_ZERO_P(state, struct nb_packet_reader);
state->reader = talloc_zero(state, struct nb_packet_reader);
if (tevent_req_nomem(state->reader, req)) {
return tevent_req_post(req, ev);
}

View File

@ -2020,7 +2020,7 @@ static void brl_revalidate(struct messaging_context *msg_ctx,
uint32 i;
struct server_id last_pid;
if (!(state = TALLOC_ZERO_P(NULL, struct brl_revalidate_state))) {
if (!(state = talloc_zero(NULL, struct brl_revalidate_state))) {
DEBUG(0, ("talloc failed\n"));
return;
}

View File

@ -579,7 +579,7 @@ static int parse_delete_tokens_list(struct share_mode_lock *lck,
p += sizeof(token_len);
pdtl = TALLOC_ZERO_P(lck, struct delete_token_list);
pdtl = talloc_zero(lck, struct delete_token_list);
if (pdtl == NULL) {
DEBUG(0,("parse_delete_tokens_list: talloc failed"));
return -1;
@ -588,7 +588,7 @@ static int parse_delete_tokens_list(struct share_mode_lock *lck,
memcpy(&pdtl->name_hash, p, sizeof(pdtl->name_hash));
p += sizeof(pdtl->name_hash);
pdtl->delete_token = TALLOC_ZERO_P(pdtl, struct security_unix_token);
pdtl->delete_token = talloc_zero(pdtl, struct security_unix_token);
if (pdtl->delete_token == NULL) {
DEBUG(0,("parse_delete_tokens_list: talloc failed"));
return -1;
@ -1513,7 +1513,7 @@ static bool add_delete_on_close_token(struct share_mode_lock *lck,
{
struct delete_token_list *dtl;
dtl = TALLOC_ZERO_P(lck, struct delete_token_list);
dtl = talloc_zero(lck, struct delete_token_list);
if (dtl == NULL) {
return false;
}

View File

@ -277,7 +277,7 @@ static struct aio_child_list *init_aio_children(struct vfs_handle_struct *handle
}
if (data == NULL) {
data = TALLOC_ZERO_P(NULL, struct aio_child_list);
data = talloc_zero(NULL, struct aio_child_list);
if (data == NULL) {
return NULL;
}
@ -481,7 +481,7 @@ static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
fdpair[0] = fdpair[1] = -1;
result = TALLOC_ZERO_P(children, struct aio_child);
result = talloc_zero(children, struct aio_child);
NT_STATUS_HAVE_NO_MEMORY(result);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fdpair) == -1) {

View File

@ -611,7 +611,7 @@ static int smb_full_audit_connect(vfs_handle_struct *handle,
return result;
}
pd = TALLOC_ZERO_P(handle, struct vfs_full_audit_private_data);
pd = talloc_zero(handle, struct vfs_full_audit_private_data);
if (!pd) {
SMB_VFS_NEXT_DISCONNECT(handle);
return -1;

View File

@ -666,7 +666,7 @@ static int smb_traffic_analyzer_connect(struct vfs_handle_struct *handle,
rf_sock->ref_count++;
} else {
/* New connection. */
rf_sock = TALLOC_ZERO_P(NULL, struct refcounted_sock);
rf_sock = talloc_zero(NULL, struct refcounted_sock);
if (rf_sock == NULL) {
SMB_VFS_NEXT_DISCONNECT(handle);
errno = ENOMEM;

View File

@ -97,7 +97,7 @@ static int tsmsm_connect(struct vfs_handle_struct *handle,
return ret;
}
tsmd = TALLOC_ZERO_P(handle, struct tsmsm_struct);
tsmd = talloc_zero(handle, struct tsmsm_struct);
if (!tsmd) {
SMB_VFS_NEXT_DISCONNECT(handle);
DEBUG(0,("tsmsm_connect: out of memory!\n"));

View File

@ -41,7 +41,7 @@ static NTSTATUS xattr_tdb_pull_attrs(TALLOC_CTX *mem_ctx,
enum ndr_err_code ndr_err;
struct tdb_xattrs *result;
if (!(result = TALLOC_ZERO_P(mem_ctx, struct tdb_xattrs))) {
if (!(result = talloc_zero(mem_ctx, struct tdb_xattrs))) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -173,7 +173,7 @@ static void nmbd_proxy_logon(struct nmbd_proxy_logon_context *ctx,
fstring source_name;
struct dgram_packet *dgram = &p->packet.dgram;
state = TALLOC_ZERO_P(ctx, struct nmbd_proxy_logon_state);
state = talloc_zero(ctx, struct nmbd_proxy_logon_state);
if (!state) {
DEBUG(0,("failed to allocate nmbd_proxy_logon_state\n"));
return;

View File

@ -74,7 +74,7 @@ struct samu *samu_new( TALLOC_CTX *ctx )
{
struct samu *user;
if ( !(user = TALLOC_ZERO_P( ctx, struct samu )) ) {
if ( !(user = talloc_zero( ctx, struct samu )) ) {
DEBUG(0,("samuser_new: Talloc failed!\n"));
return NULL;
}

View File

@ -6480,7 +6480,7 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c
/* TODO: Setup private data and free */
if ( !(ldap_state = TALLOC_ZERO_P(*pdb_method, struct ldapsam_privates)) ) {
if ( !(ldap_state = talloc_zero(*pdb_method, struct ldapsam_privates)) ) {
DEBUG(0, ("pdb_init_ldapsam_common: talloc() failed for ldapsam private_data!\n"));
return NT_STATUS_NO_MEMORY;
}

View File

@ -1694,7 +1694,7 @@ static NTSTATUS pdb_init_smbpasswd( struct pdb_methods **pdb_method, const char
/* Setup private data and free function */
if ( !(privates = TALLOC_ZERO_P( *pdb_method, struct smbpasswd_privates )) ) {
if ( !(privates = talloc_zero( *pdb_method, struct smbpasswd_privates )) ) {
DEBUG(0, ("talloc() failed for smbpasswd private_data!\n"));
return NT_STATUS_NO_MEMORY;
}

View File

@ -919,7 +919,7 @@ static WERROR move_driver_file_to_download_area(TALLOC_CTX *mem_ctx,
}
/* Setup a synthetic smb_filename struct */
smb_fname_new = TALLOC_ZERO_P(mem_ctx, struct smb_filename);
smb_fname_new = talloc_zero(mem_ctx, struct smb_filename);
if (!smb_fname_new) {
ret = WERR_NOMEM;
goto out;

View File

@ -142,9 +142,9 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
SMB_ASSERT(strchr(name, '\\') == NULL);
if (!(regkey = TALLOC_ZERO_P(mem_ctx, struct registry_key)) ||
if (!(regkey = talloc_zero(mem_ctx, struct registry_key)) ||
!(regkey->token = dup_nt_token(regkey, token)) ||
!(regkey->key = TALLOC_ZERO_P(regkey, struct registry_key_handle)))
!(regkey->key = talloc_zero(regkey, struct registry_key_handle)))
{
result = WERR_NOMEM;
goto done;

View File

@ -62,7 +62,7 @@ struct regsubkey_ctr {
context for internal private data.
There is no longer a regval_ctr_intit() and regval_ctr_destroy()
pair of functions. Simply TALLOC_ZERO_P() and TALLOC_FREE() the
pair of functions. Simply talloc_zero() and TALLOC_FREE() the
object.
**********************************************************************/

View File

@ -38,7 +38,7 @@ NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
token = TALLOC_ZERO_P(mem_ctx, struct security_token);
token = talloc_zero(mem_ctx, struct security_token);
if (token == NULL) {
DEBUG(1, ("talloc failed\n"));
status = NT_STATUS_NO_MEMORY;

View File

@ -498,7 +498,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset )
REGF_HBIN *hbin;
uint32 record_size, curr_off, block_size, header;
if ( !(hbin = TALLOC_ZERO_P(file->mem_ctx, REGF_HBIN)) )
if ( !(hbin = talloc_zero(file->mem_ctx, REGF_HBIN)) )
return NULL;
hbin->file_off = offset;
hbin->free_off = -1;
@ -1073,7 +1073,7 @@ static bool hbin_prs_key( REGF_FILE *file, REGF_HBIN *hbin, REGF_NK_REC *nk )
}
}
if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) )
if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) )
return False;
nk->sec_desc->sk_off = nk->sk_off;
if ( !hbin_prs_sk_rec( "sk_rec", sub_hbin, depth, nk->sec_desc ))
@ -1379,7 +1379,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file )
if ( !file )
return NULL;
if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) {
if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) {
DEBUG(0,("regfio_rootkey: talloc() failed!\n"));
return NULL;
}
@ -1447,7 +1447,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file )
return NULL;
nk->subkey_index++;
if ( !(subkey = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) )
if ( !(subkey = talloc_zero( file->mem_ctx, REGF_NK_REC )) )
return NULL;
if ( !hbin_prs_key( file, hbin, subkey ) )
@ -1465,7 +1465,7 @@ static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size )
REGF_HBIN *hbin;
SMB_STRUCT_STAT sbuf;
if ( !(hbin = TALLOC_ZERO_P( file->mem_ctx, REGF_HBIN )) )
if ( !(hbin = talloc_zero( file->mem_ctx, REGF_HBIN )) )
return NULL;
memcpy( hbin->header, "hbin", sizeof(HBIN_HDR_SIZE) );
@ -1765,7 +1765,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
REGF_HBIN *vlist_hbin = NULL;
uint32 size;
if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) )
if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) )
return NULL;
memcpy( nk->header, "nk", REC_HDR_SIZE );
@ -1831,7 +1831,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
return NULL;
}
if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) )
if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) )
return NULL;
/* now we have to store the security descriptor in the list and

View File

@ -177,7 +177,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
ZERO_STRUCT(ret_creds);
logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
logon = talloc_zero(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
@ -200,7 +200,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
struct samr_Password lmpassword;
struct samr_Password ntpassword;
password_info = TALLOC_ZERO_P(mem_ctx, struct netr_PasswordInfo);
password_info = talloc_zero(mem_ctx, struct netr_PasswordInfo);
if (!password_info) {
return NT_STATUS_NO_MEMORY;
}
@ -240,7 +240,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo);
network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo);
if (!network_info) {
return NT_STATUS_NO_MEMORY;
}
@ -388,12 +388,12 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
logon = talloc_zero(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo);
network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo);
if (!network_info) {
return NT_STATUS_NO_MEMORY;
}
@ -505,12 +505,12 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
logon = talloc_zero(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo);
network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo);
if (!network_info) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -2431,7 +2431,7 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host,
NTSTATUS status;
int fd;
result = TALLOC_ZERO_P(mem_ctx, struct rpc_pipe_client);
result = talloc_zero(mem_ctx, struct rpc_pipe_client);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -2540,7 +2540,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host,
/* create tower for asking the epmapper */
map_binding = TALLOC_ZERO_P(tmp_ctx, struct dcerpc_binding);
map_binding = talloc_zero(tmp_ctx, struct dcerpc_binding);
if (map_binding == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
@ -2551,7 +2551,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host,
map_binding->host = host; /* needed? */
map_binding->endpoint = "0"; /* correct? needed? */
map_tower = TALLOC_ZERO_P(tmp_ctx, struct epm_twr_t);
map_tower = talloc_zero(tmp_ctx, struct epm_twr_t);
if (map_tower == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
@ -2572,7 +2572,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host,
}
towers.twr = res_towers;
entry_handle = TALLOC_ZERO_P(tmp_ctx, struct policy_handle);
entry_handle = talloc_zero(tmp_ctx, struct policy_handle);
if (entry_handle == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
@ -2756,7 +2756,7 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli,
return NT_STATUS_INVALID_HANDLE;
}
result = TALLOC_ZERO_P(NULL, struct rpc_pipe_client);
result = talloc_zero(NULL, struct rpc_pipe_client);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -59,7 +59,7 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
return WERR_ACCESS_DENIED;
}
jn = TALLOC_ZERO_P(ctx, struct junction_map);
jn = talloc_zero(ctx, struct junction_map);
if (!jn) {
return WERR_NOMEM;
}
@ -124,7 +124,7 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
return WERR_ACCESS_DENIED;
}
jn = TALLOC_ZERO_P(ctx, struct junction_map);
jn = talloc_zero(ctx, struct junction_map);
if (!jn) {
return WERR_NOMEM;
}
@ -354,7 +354,7 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
TALLOC_CTX *ctx = talloc_tos();
bool ret;
jn = TALLOC_ZERO_P(ctx, struct junction_map);
jn = talloc_zero(ctx, struct junction_map);
if (!jn) {
return WERR_NOMEM;
}
@ -372,28 +372,28 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
switch (r->in.level) {
case 1:
r->out.info->info1 = TALLOC_ZERO_P(ctx,struct dfs_Info1);
r->out.info->info1 = talloc_zero(ctx,struct dfs_Info1);
if (!r->out.info->info1) {
return WERR_NOMEM;
}
ret = init_reply_dfs_info_1(ctx, jn, r->out.info->info1);
break;
case 2:
r->out.info->info2 = TALLOC_ZERO_P(ctx,struct dfs_Info2);
r->out.info->info2 = talloc_zero(ctx,struct dfs_Info2);
if (!r->out.info->info2) {
return WERR_NOMEM;
}
ret = init_reply_dfs_info_2(ctx, jn, r->out.info->info2);
break;
case 3:
r->out.info->info3 = TALLOC_ZERO_P(ctx,struct dfs_Info3);
r->out.info->info3 = talloc_zero(ctx,struct dfs_Info3);
if (!r->out.info->info3) {
return WERR_NOMEM;
}
ret = init_reply_dfs_info_3(ctx, jn, r->out.info->info3);
break;
case 100:
r->out.info->info100 = TALLOC_ZERO_P(ctx,struct dfs_Info100);
r->out.info->info100 = talloc_zero(ctx,struct dfs_Info100);
if (!r->out.info->info100) {
return WERR_NOMEM;
}

View File

@ -42,7 +42,7 @@ static WERROR fill_dsrole_dominfo_basic(TALLOC_CTX *ctx,
DEBUG(10,("fill_dsrole_dominfo_basic: enter\n"));
basic = TALLOC_ZERO_P(ctx, struct dssetup_DsRolePrimaryDomInfoBasic);
basic = talloc_zero(ctx, struct dssetup_DsRolePrimaryDomInfoBasic);
if (!basic) {
DEBUG(0,("fill_dsrole_dominfo_basic: out of memory\n"));
return WERR_NOMEM;

View File

@ -212,7 +212,7 @@ static NTSTATUS elog_open( struct pipes_struct * p, const char *logname, struct
if ( !elog_validate_logname( logname ) )
return NT_STATUS_OBJECT_PATH_INVALID;
if ( !(elog = TALLOC_ZERO_P( NULL, EVENTLOG_INFO )) )
if ( !(elog = talloc_zero( NULL, EVENTLOG_INFO )) )
return NT_STATUS_NO_MEMORY;
talloc_set_destructor(elog, eventlog_info_destructor);

View File

@ -628,7 +628,7 @@ NTSTATUS _lsa_QueryInfoPolicy(struct pipes_struct *p,
/* return NT_STATUS_ACCESS_DENIED; */
}
info = TALLOC_ZERO_P(p->mem_ctx, union lsa_PolicyInformation);
info = talloc_zero(p->mem_ctx, union lsa_PolicyInformation);
if (!info) {
return NT_STATUS_NO_MEMORY;
}
@ -859,7 +859,7 @@ static NTSTATUS _lsa_lookup_sids_internal(struct pipes_struct *p,
}
sids = talloc_array(p->mem_ctx, const struct dom_sid *, num_sids);
ref = TALLOC_ZERO_P(p->mem_ctx, struct lsa_RefDomainList);
ref = talloc_zero(p->mem_ctx, struct lsa_RefDomainList);
if (sids == NULL || ref == NULL) {
return NT_STATUS_NO_MEMORY;
@ -1168,7 +1168,7 @@ NTSTATUS _lsa_LookupNames(struct pipes_struct *p,
flags = lsa_lookup_level_to_flags(r->in.level);
domains = TALLOC_ZERO_P(p->mem_ctx, struct lsa_RefDomainList);
domains = talloc_zero(p->mem_ctx, struct lsa_RefDomainList);
if (!domains) {
return NT_STATUS_NO_MEMORY;
}
@ -1235,7 +1235,7 @@ NTSTATUS _lsa_LookupNames2(struct pipes_struct *p,
struct lsa_TransSidArray *sid_array = NULL;
uint32_t i;
sid_array = TALLOC_ZERO_P(p->mem_ctx, struct lsa_TransSidArray);
sid_array = talloc_zero(p->mem_ctx, struct lsa_TransSidArray);
if (!sid_array) {
return NT_STATUS_NO_MEMORY;
}
@ -1310,7 +1310,7 @@ NTSTATUS _lsa_LookupNames3(struct pipes_struct *p,
flags = LOOKUP_NAME_ALL;
}
domains = TALLOC_ZERO_P(p->mem_ctx, struct lsa_RefDomainList);
domains = talloc_zero(p->mem_ctx, struct lsa_RefDomainList);
if (!domains) {
return NT_STATUS_NO_MEMORY;
}
@ -2012,7 +2012,7 @@ NTSTATUS _lsa_QueryTrustedDomainInfo(struct pipes_struct *p,
return status;
}
info = TALLOC_ZERO_P(p->mem_ctx, union lsa_TrustedDomainInfo);
info = talloc_zero(p->mem_ctx, union lsa_TrustedDomainInfo);
if (!info) {
return NT_STATUS_NO_MEMORY;
}
@ -2299,7 +2299,7 @@ NTSTATUS _lsa_LookupPrivDisplayName(struct pipes_struct *p,
DEBUG(10,("_lsa_LookupPrivDisplayName: display name = %s\n", description));
lsa_name = TALLOC_ZERO_P(p->mem_ctx, struct lsa_StringLarge);
lsa_name = talloc_zero(p->mem_ctx, struct lsa_StringLarge);
if (!lsa_name) {
return NT_STATUS_NO_MEMORY;
}
@ -2597,7 +2597,7 @@ NTSTATUS _lsa_EnumPrivsAccount(struct pipes_struct *p,
return status;
}
*r->out.privs = priv_set = TALLOC_ZERO_P(p->mem_ctx, struct lsa_PrivilegeSet);
*r->out.privs = priv_set = talloc_zero(p->mem_ctx, struct lsa_PrivilegeSet);
if (!priv_set) {
return NT_STATUS_NO_MEMORY;
}
@ -2801,7 +2801,7 @@ NTSTATUS _lsa_LookupPrivName(struct pipes_struct *p,
return NT_STATUS_NO_SUCH_PRIVILEGE;
}
lsa_name = TALLOC_ZERO_P(p->mem_ctx, struct lsa_StringLarge);
lsa_name = talloc_zero(p->mem_ctx, struct lsa_StringLarge);
if (!lsa_name) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -346,7 +346,7 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
switch (r->in.level) {
case 1:
info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
info1 = talloc_zero(p->mem_ctx, struct netr_NETLOGON_INFO_1);
W_ERROR_HAVE_NO_MEMORY(info1);
info1->flags = flags;
@ -355,7 +355,7 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
r->out.query->info1 = info1;
break;
case 2:
info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2);
info2 = talloc_zero(p->mem_ctx, struct netr_NETLOGON_INFO_2);
W_ERROR_HAVE_NO_MEMORY(info2);
info2->flags = flags;
@ -366,7 +366,7 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
r->out.query->info2 = info2;
break;
case 3:
info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3);
info3 = talloc_zero(p->mem_ctx, struct netr_NETLOGON_INFO_3);
W_ERROR_HAVE_NO_MEMORY(info3);
info3->flags = flags;
@ -375,7 +375,7 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
r->out.query->info3 = info3;
break;
case 4:
info4 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_4);
info4 = talloc_zero(p->mem_ctx, struct netr_NETLOGON_INFO_4);
W_ERROR_HAVE_NO_MEMORY(info4);
info4->trusted_dc_name = dc_name;
@ -1421,19 +1421,19 @@ static NTSTATUS _netr_LogonSamLogon_base(struct pipes_struct *p,
switch (r->in.validation_level) {
case 2:
r->out.validation->sam2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo2);
r->out.validation->sam2 = talloc_zero(p->mem_ctx, struct netr_SamInfo2);
if (!r->out.validation->sam2) {
return NT_STATUS_NO_MEMORY;
}
break;
case 3:
r->out.validation->sam3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo3);
r->out.validation->sam3 = talloc_zero(p->mem_ctx, struct netr_SamInfo3);
if (!r->out.validation->sam3) {
return NT_STATUS_NO_MEMORY;
}
break;
case 6:
r->out.validation->sam6 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo6);
r->out.validation->sam6 = talloc_zero(p->mem_ctx, struct netr_SamInfo6);
if (!r->out.validation->sam6) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -131,7 +131,7 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
DEBUG(4,("Create pipe requested %s\n",
get_pipe_name_from_syntax(talloc_tos(), syntax)));
p = TALLOC_ZERO_P(mem_ctx, struct pipes_struct);
p = talloc_zero(mem_ctx, struct pipes_struct);
if (!p) {
DEBUG(0,("ERROR! no memory for pipes_struct!\n"));
@ -563,7 +563,7 @@ static NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *result;
NTSTATUS status;
result = TALLOC_ZERO_P(mem_ctx, struct rpc_pipe_client);
result = talloc_zero(mem_ctx, struct rpc_pipe_client);
if (result == NULL) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -842,7 +842,7 @@ NTSTATUS _samr_EnumDomainUsers(struct pipes_struct *p,
return status;
}
samr_array = TALLOC_ZERO_P(p->mem_ctx, struct samr_SamArray);
samr_array = talloc_zero(p->mem_ctx, struct samr_SamArray);
if (!samr_array) {
return NT_STATUS_NO_MEMORY;
}
@ -977,7 +977,7 @@ NTSTATUS _samr_EnumDomainGroups(struct pipes_struct *p,
DEBUG(5,("_samr_EnumDomainGroups: %d\n", __LINE__));
samr_array = TALLOC_ZERO_P(p->mem_ctx, struct samr_SamArray);
samr_array = talloc_zero(p->mem_ctx, struct samr_SamArray);
if (!samr_array) {
return NT_STATUS_NO_MEMORY;
}
@ -1055,7 +1055,7 @@ NTSTATUS _samr_EnumDomainAliases(struct pipes_struct *p,
DEBUG(5,("_samr_EnumDomainAliases: sid %s\n",
sid_string_dbg(&dinfo->sid)));
samr_array = TALLOC_ZERO_P(p->mem_ctx, struct samr_SamArray);
samr_array = talloc_zero(p->mem_ctx, struct samr_SamArray);
if (!samr_array) {
return NT_STATUS_NO_MEMORY;
}
@ -1578,7 +1578,7 @@ NTSTATUS _samr_QueryAliasInfo(struct pipes_struct *p,
return status;
}
alias_info = TALLOC_ZERO_P(p->mem_ctx, union samr_AliasInfo);
alias_info = talloc_zero(p->mem_ctx, union samr_AliasInfo);
if (!alias_info) {
return NT_STATUS_NO_MEMORY;
}
@ -1984,12 +1984,12 @@ NTSTATUS _samr_ChangePasswordUser3(struct pipes_struct *p,
time_t u_expire, u_min_age;
uint32 account_policy_temp;
dominfo = TALLOC_ZERO_P(p->mem_ctx, struct samr_DomInfo1);
dominfo = talloc_zero(p->mem_ctx, struct samr_DomInfo1);
if (!dominfo) {
return NT_STATUS_NO_MEMORY;
}
reject = TALLOC_ZERO_P(p->mem_ctx,
reject = talloc_zero(p->mem_ctx,
struct userPwdChangeFailureInformation);
if (!reject) {
return NT_STATUS_NO_MEMORY;
@ -2288,7 +2288,7 @@ static NTSTATUS init_samr_parameters_string(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
r = TALLOC_ZERO_P(mem_ctx, struct lsa_BinaryString);
r = talloc_zero(mem_ctx, struct lsa_BinaryString);
if (!r) {
return NT_STATUS_NO_MEMORY;
}
@ -2987,7 +2987,7 @@ NTSTATUS _samr_QueryUserInfo(struct pipes_struct *p,
DEBUG(5,("_samr_QueryUserInfo: sid:%s\n",
sid_string_dbg(&uinfo->sid)));
user_info = TALLOC_ZERO_P(p->mem_ctx, union samr_UserInfo);
user_info = talloc_zero(p->mem_ctx, union samr_UserInfo);
if (!user_info) {
return NT_STATUS_NO_MEMORY;
}
@ -3149,7 +3149,7 @@ NTSTATUS _samr_GetGroupsForUser(struct pipes_struct *p,
return result;
}
rids = TALLOC_ZERO_P(p->mem_ctx, struct samr_RidWithAttributeArray);
rids = talloc_zero(p->mem_ctx, struct samr_RidWithAttributeArray);
if (!rids) {
return NT_STATUS_NO_MEMORY;
}
@ -3598,7 +3598,7 @@ NTSTATUS _samr_QueryDomainInfo(struct pipes_struct *p,
return status;
}
dom_info = TALLOC_ZERO_P(p->mem_ctx, union samr_DomainInfo);
dom_info = talloc_zero(p->mem_ctx, union samr_DomainInfo);
if (!dom_info) {
return NT_STATUS_NO_MEMORY;
}
@ -4054,7 +4054,7 @@ NTSTATUS _samr_LookupDomain(struct pipes_struct *p,
return NT_STATUS_INVALID_PARAMETER;
}
sid = TALLOC_ZERO_P(p->mem_ctx, struct dom_sid2);
sid = talloc_zero(p->mem_ctx, struct dom_sid2);
if (!sid) {
return NT_STATUS_NO_MEMORY;
}
@ -4095,7 +4095,7 @@ NTSTATUS _samr_EnumDomains(struct pipes_struct *p,
return status;
}
sam = TALLOC_ZERO_P(p->mem_ctx, struct samr_SamArray);
sam = talloc_zero(p->mem_ctx, struct samr_SamArray);
if (!sam) {
return NT_STATUS_NO_MEMORY;
}
@ -5415,7 +5415,7 @@ NTSTATUS _samr_QueryGroupMember(struct pipes_struct *p,
return status;
}
rids = TALLOC_ZERO_P(p->mem_ctx, struct samr_RidAttrArray);
rids = talloc_zero(p->mem_ctx, struct samr_RidAttrArray);
if (!rids) {
return NT_STATUS_NO_MEMORY;
}
@ -5954,7 +5954,7 @@ NTSTATUS _samr_QueryGroupInfo(struct pipes_struct *p,
group_name = talloc_strdup(r, map.nt_name);
group_description = talloc_strdup(r, map.comment);
info = TALLOC_ZERO_P(p->mem_ctx, union samr_GroupInfo);
info = talloc_zero(p->mem_ctx, union samr_GroupInfo);
if (!info) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -600,7 +600,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
alloc_entries = num_entries - resume_handle;
switch (info_ctr->level) {
case 0:
ctr.ctr0 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr0);
ctr.ctr0 = talloc_zero(ctx, struct srvsvc_NetShareCtr0);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr0);
ctr.ctr0->count = alloc_entries;
@ -617,7 +617,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1:
ctr.ctr1 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1);
ctr.ctr1 = talloc_zero(ctx, struct srvsvc_NetShareCtr1);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1);
ctr.ctr1->count = alloc_entries;
@ -634,7 +634,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 2:
ctr.ctr2 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr2);
ctr.ctr2 = talloc_zero(ctx, struct srvsvc_NetShareCtr2);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr2);
ctr.ctr2->count = alloc_entries;
@ -651,7 +651,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 501:
ctr.ctr501 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr501);
ctr.ctr501 = talloc_zero(ctx, struct srvsvc_NetShareCtr501);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr501);
ctr.ctr501->count = alloc_entries;
@ -668,7 +668,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 502:
ctr.ctr502 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr502);
ctr.ctr502 = talloc_zero(ctx, struct srvsvc_NetShareCtr502);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr502);
ctr.ctr502->count = alloc_entries;
@ -685,7 +685,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1004:
ctr.ctr1004 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1004);
ctr.ctr1004 = talloc_zero(ctx, struct srvsvc_NetShareCtr1004);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1004);
ctr.ctr1004->count = alloc_entries;
@ -702,7 +702,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1005:
ctr.ctr1005 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1005);
ctr.ctr1005 = talloc_zero(ctx, struct srvsvc_NetShareCtr1005);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1005);
ctr.ctr1005->count = alloc_entries;
@ -719,7 +719,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1006:
ctr.ctr1006 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1006);
ctr.ctr1006 = talloc_zero(ctx, struct srvsvc_NetShareCtr1006);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1006);
ctr.ctr1006->count = alloc_entries;
@ -736,7 +736,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1007:
ctr.ctr1007 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1007);
ctr.ctr1007 = talloc_zero(ctx, struct srvsvc_NetShareCtr1007);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1007);
ctr.ctr1007->count = alloc_entries;
@ -753,7 +753,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
break;
case 1501:
ctr.ctr1501 = TALLOC_ZERO_P(ctx, struct srvsvc_NetShareCtr1501);
ctr.ctr1501 = talloc_zero(ctx, struct srvsvc_NetShareCtr1501);
W_ERROR_HAVE_NO_MEMORY(ctr.ctr1501);
ctr.ctr1501->count = alloc_entries;
@ -2062,7 +2062,7 @@ WERROR _srvsvc_NetRemoteTOD(struct pipes_struct *p,
DEBUG(5,("_srvsvc_NetRemoteTOD: %d\n", __LINE__));
if ( !(tod = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetRemoteTODInfo)) )
if ( !(tod = talloc_zero(p->mem_ctx, struct srvsvc_NetRemoteTODInfo)) )
return WERR_NOMEM;
*r->out.info = tod;
@ -2189,7 +2189,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
sd_size = ndr_size_security_descriptor(psd, 0);
sd_buf = TALLOC_ZERO_P(p->mem_ctx, struct sec_desc_buf);
sd_buf = talloc_zero(p->mem_ctx, struct sec_desc_buf);
if (!sd_buf) {
werr = WERR_NOMEM;
goto error_exit;

View File

@ -209,7 +209,7 @@ static WERROR create_open_service_handle(struct pipes_struct *p,
WERROR result = WERR_OK;
struct service_control_op *s_op;
if ( !(info = TALLOC_ZERO_P( NULL, SERVICE_INFO )) )
if ( !(info = talloc_zero( NULL, SERVICE_INFO )) )
return WERR_NOMEM;
/* the Service Manager has a NULL name */

View File

@ -116,7 +116,7 @@ static struct aio_extra *create_aio_extra(TALLOC_CTX *mem_ctx,
files_struct *fsp,
size_t buflen)
{
struct aio_extra *aio_ex = TALLOC_ZERO_P(mem_ctx, struct aio_extra);
struct aio_extra *aio_ex = talloc_zero(mem_ctx, struct aio_extra);
if (!aio_ex) {
return NULL;

View File

@ -133,7 +133,7 @@ connection_struct *conn_new(struct smbd_server_connection *sconn)
if (sconn->using_smb2) {
/* SMB2 */
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
if (!(conn=talloc_zero(NULL, connection_struct)) ||
!(conn->params = talloc(conn, struct share_params))) {
DEBUG(0,("TALLOC_ZERO() failed!\n"));
TALLOC_FREE(conn);
@ -188,7 +188,7 @@ find_again:
return NULL;
}
if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
if (!(conn=talloc_zero(NULL, connection_struct)) ||
!(conn->params = talloc(conn, struct share_params))) {
DEBUG(0,("TALLOC_ZERO() failed!\n"));
TALLOC_FREE(conn);

View File

@ -1342,7 +1342,7 @@ struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn,
const char *mask,
uint32 attr)
{
struct smb_Dir *dirp = TALLOC_ZERO_P(mem_ctx, struct smb_Dir);
struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir);
struct smbd_server_connection *sconn = conn->sconn;
if (!dirp) {
@ -1386,7 +1386,7 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
const char *mask,
uint32 attr)
{
struct smb_Dir *dirp = TALLOC_ZERO_P(mem_ctx, struct smb_Dir);
struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir);
struct smbd_server_connection *sconn = conn->sconn;
if (!dirp) {

View File

@ -202,7 +202,7 @@ void reply_sendstrt(struct smb_request *req)
TALLOC_FREE(smbd_msg_state);
smbd_msg_state = TALLOC_ZERO_P(NULL, struct msg_state);
smbd_msg_state = talloc_zero(NULL, struct msg_state);
if (smbd_msg_state == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);

View File

@ -231,7 +231,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
char *oldcwd;
const char *vfs_user;
conn = TALLOC_ZERO_P(ctx, connection_struct);
conn = talloc_zero(ctx, connection_struct);
if (conn == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -252,7 +252,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
/* needed for smbd_vfs_init() */
if (!(conn->params = TALLOC_ZERO_P(conn, struct share_params))) {
if (!(conn->params = talloc_zero(conn, struct share_params))) {
DEBUG(0, ("TALLOC failed\n"));
TALLOC_FREE(conn);
return NT_STATUS_NO_MEMORY;
@ -794,7 +794,7 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx,
*self_referralp = True;
jucn->referral_count = 1;
if((ref = TALLOC_ZERO_P(ctx, struct referral)) == NULL) {
if((ref = talloc_zero(ctx, struct referral)) == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -899,7 +899,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
*/
jucn->referral_count = 1;
if ((ref = TALLOC_ZERO_P(ctx, struct referral)) == NULL) {
if ((ref = talloc_zero(ctx, struct referral)) == NULL) {
TALLOC_FREE(pdp);
return NT_STATUS_NO_MEMORY;
}
@ -1233,7 +1233,7 @@ int setup_dfs_referral(connection_struct *orig_conn,
pathnamep++;
}
junction = TALLOC_ZERO_P(ctx, struct junction_map);
junction = talloc_zero(ctx, struct junction_map);
if (!junction) {
*pstatus = NT_STATUS_NO_MEMORY;
talloc_destroy(ctx);
@ -1630,7 +1630,7 @@ static int form_junctions(TALLOC_CTX *ctx,
jucn[cnt].comment = "";
jucn[cnt].referral_count = 1;
ref = jucn[cnt].referral_list = TALLOC_ZERO_P(ctx, struct referral);
ref = jucn[cnt].referral_list = talloc_zero(ctx, struct referral);
if (jucn[cnt].referral_list == NULL) {
goto out;
}

View File

@ -183,7 +183,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
SMB_ASSERT(fsp->notify == NULL);
if (!(fsp->notify = TALLOC_ZERO_P(NULL, struct notify_change_buf))) {
if (!(fsp->notify = talloc_zero(NULL, struct notify_change_buf))) {
DEBUG(0, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
}

View File

@ -198,7 +198,7 @@ static NTSTATUS notify_load(struct notify_context *notify, struct db_record *rec
notify->seqnum = seqnum;
talloc_free(notify->array);
notify->array = TALLOC_ZERO_P(notify, struct notify_array);
notify->array = talloc_zero(notify, struct notify_array);
NT_STATUS_HAVE_NO_MEMORY(notify->array);
if (!rec) {
@ -531,7 +531,7 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,
depth = count_chars(e.path, '/');
listel = TALLOC_ZERO_P(notify, struct notify_list);
listel = talloc_zero(notify, struct notify_list);
if (listel == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;

View File

@ -201,14 +201,14 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list)
DEBUG(15,("quota entry for id[%s] path[%s]\n",
sid_string_dbg(&sid), fsp->conn->connectpath));
if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
if ((tmp_list_ent=talloc_zero(mem_ctx,SMB_NTQUOTA_LIST))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
*qt_list = NULL;
talloc_destroy(mem_ctx);
return (-1);
}
if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
if ((tmp_list_ent->quotas=talloc_zero(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
*qt_list = NULL;
talloc_destroy(mem_ctx);
@ -241,7 +241,7 @@ void *init_quota_handle(TALLOC_CTX *mem_ctx)
if (!mem_ctx)
return False;
qt_handle = TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_HANDLE);
qt_handle = talloc_zero(mem_ctx,SMB_NTQUOTA_HANDLE);
if (qt_handle==NULL) {
DEBUG(0,("TALLOC_ZERO() failed\n"));
return NULL;

View File

@ -2235,7 +2235,7 @@ static void call_nt_transact_ioctl(connection_struct *conn,
labels = True;
}
shadow_data = TALLOC_ZERO_P(talloc_tos(),
shadow_data = talloc_zero(talloc_tos(),
struct shadow_copy_data);
if (shadow_data == NULL) {
DEBUG(0,("TALLOC_ZERO() failed!\n"));

View File

@ -4744,7 +4744,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna
struct fd_handle fh;
NTSTATUS status;
conn = TALLOC_ZERO_P(ctx, connection_struct);
conn = talloc_zero(ctx, connection_struct);
if (conn == NULL) {
DEBUG(0, ("talloc failed\n"));
return NULL;

View File

@ -594,7 +594,7 @@ static bool push_queued_message(struct smb_request *req,
int msg_len = smb_len(req->inbuf) + 4;
struct pending_message_list *msg;
msg = TALLOC_ZERO_P(NULL, struct pending_message_list);
msg = talloc_zero(NULL, struct pending_message_list);
if(msg == NULL) {
DEBUG(0,("push_message: malloc fail (1)\n"));

View File

@ -411,7 +411,7 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx,
labels = True;
}
shadow_data = TALLOC_ZERO_P(talloc_tos(),
shadow_data = talloc_zero(talloc_tos(),
struct shadow_copy_data);
if (tevent_req_nomem(shadow_data, req)) {
DEBUG(0,("TALLOC_ZERO() failed!\n"));

View File

@ -590,7 +590,7 @@ static struct ea_list *read_ea_name_list(TALLOC_CTX *ctx, const char *pdata, siz
size_t converted_size, offset = 0;
while (offset + 2 < data_size) {
struct ea_list *eal = TALLOC_ZERO_P(ctx, struct ea_list);
struct ea_list *eal = talloc_zero(ctx, struct ea_list);
unsigned int namelen = CVAL(pdata,offset);
offset++; /* Go past the namelen byte. */
@ -628,7 +628,7 @@ static struct ea_list *read_ea_name_list(TALLOC_CTX *ctx, const char *pdata, siz
struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used)
{
struct ea_list *eal = TALLOC_ZERO_P(ctx, struct ea_list);
struct ea_list *eal = talloc_zero(ctx, struct ea_list);
uint16 val_len;
unsigned int namelen;
size_t converted_size;

View File

@ -183,7 +183,7 @@ bool vfs_init_custom(connection_struct *conn, const char *vfs_object)
DEBUGADD(5,("Successfully loaded vfs module [%s] with the new modules system\n", vfs_object));
handle = TALLOC_ZERO_P(conn, vfs_handle_struct);
handle = talloc_zero(conn, vfs_handle_struct);
if (!handle) {
DEBUG(0,("TALLOC_ZERO() failed!\n"));
goto fail;

View File

@ -469,7 +469,7 @@ int main(int argc, char *argv[])
/* some basic initialization stuff */
sec_init();
vfs.conn = TALLOC_ZERO_P(NULL, connection_struct);
vfs.conn = talloc_zero(NULL, connection_struct);
vfs.conn->params = talloc(vfs.conn, struct share_params);
for (i=0; i < 1024; i++)
vfs.files[i] = NULL;

View File

@ -3431,7 +3431,7 @@ static WERROR get_share_info(struct net_context *c,
{
struct srvsvc_NetShareCtr1 *ctr1;
ctr1 = TALLOC_ZERO_P(mem_ctx, struct srvsvc_NetShareCtr1);
ctr1 = talloc_zero(mem_ctx, struct srvsvc_NetShareCtr1);
W_ERROR_HAVE_NO_MEMORY(ctr1);
ctr1->count = 1;
@ -3445,7 +3445,7 @@ static WERROR get_share_info(struct net_context *c,
{
struct srvsvc_NetShareCtr2 *ctr2;
ctr2 = TALLOC_ZERO_P(mem_ctx, struct srvsvc_NetShareCtr2);
ctr2 = talloc_zero(mem_ctx, struct srvsvc_NetShareCtr2);
W_ERROR_HAVE_NO_MEMORY(ctr2);
ctr2->count = 1;
@ -3459,7 +3459,7 @@ static WERROR get_share_info(struct net_context *c,
{
struct srvsvc_NetShareCtr502 *ctr502;
ctr502 = TALLOC_ZERO_P(mem_ctx, struct srvsvc_NetShareCtr502);
ctr502 = talloc_zero(mem_ctx, struct srvsvc_NetShareCtr502);
W_ERROR_HAVE_NO_MEMORY(ctr502);
ctr502->count = 1;

View File

@ -1451,7 +1451,7 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c,
return status;
}
sd = TALLOC_ZERO_P(mem_ctx, struct KeySecurityData);
sd = talloc_zero(mem_ctx, struct KeySecurityData);
if (!sd) {
status = NT_STATUS_NO_MEMORY;
goto out;

View File

@ -216,7 +216,7 @@ static NTSTATUS idmap_ad_initialize(struct idmap_domain *dom)
char *config_option;
const char *schema_mode = NULL;
ctx = TALLOC_ZERO_P(dom, struct idmap_ad_context);
ctx = talloc_zero(dom, struct idmap_ad_context);
if (ctx == NULL) {
DEBUG(0, ("Out of memory!\n"));
return NT_STATUS_NO_MEMORY;
@ -736,7 +736,7 @@ static NTSTATUS nss_ad_generic_init(struct nss_domain_entry *e,
if (e->state != NULL) {
dom = talloc_get_type(e->state, struct idmap_domain);
} else {
dom = TALLOC_ZERO_P(e, struct idmap_domain);
dom = talloc_zero(e, struct idmap_domain);
if (dom == NULL) {
DEBUG(0, ("Out of memory!\n"));
return NT_STATUS_NO_MEMORY;
@ -756,7 +756,7 @@ static NTSTATUS nss_ad_generic_init(struct nss_domain_entry *e,
ctx = talloc_get_type(dom->private_data,
struct idmap_ad_context);
} else {
ctx = TALLOC_ZERO_P(dom, struct idmap_ad_context);
ctx = talloc_zero(dom, struct idmap_ad_context);
if (ctx == NULL) {
DEBUG(0, ("Out of memory!\n"));
return NT_STATUS_NO_MEMORY;

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