#define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count))
#define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__)
-#define talloc_destroy(ctx) talloc_free(ctx)
#ifndef TALLOC_FREE
#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
#endif
ldap_controls_free(rcontrols);
done:
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
if (ext_be) {
ber_free(ext_be, 1);
}
done:
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
/* if/when we decide to utf8-encode attrs, take out this next line */
TALLOC_FREE(search_attrs);
return ADS_ERROR(rc);
}
if (!(mods = ads_init_mods(ctx))) {
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
ads_msgfree(ads, res);
return ADS_ERROR(LDAP_NO_MEMORY);
}
if (!ADS_ERR_OK(ret)) {
DEBUG(1,("ads_clear_service_principal_names: Error creating strlist.\n"));
ads_msgfree(ads, res);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
dn_string = ads_get_dn(ads, talloc_tos(), res);
if (!dn_string) {
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
ads_msgfree(ads, res);
return ADS_ERROR(LDAP_NO_MEMORY);
}
DEBUG(1,("ads_clear_service_principal_names: Error: Updating Service Principals for machine %s in LDAP\n",
machine_name));
ads_msgfree(ads, res);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
ads_msgfree(ads, res);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
done:
SAFE_FREE(machine_escaped);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
fn(ads, NULL, NULL, data_area); /* completed an entry */
}
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
}
/**
done:
SAFE_FREE(name_escaped);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return status;
}
done:
SAFE_FREE(name_escaped);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return status;
}
#endif
return;
}
- if ((*qt_list)->mem_ctx)
- talloc_destroy((*qt_list)->mem_ctx);
+ TALLOC_FREE((*qt_list)->mem_ctx);
(*qt_list) = NULL;
if(l_new == NULL) {
DEBUG(0,("posix_lock_list: talloc fail.\n"));
- return NULL; /* The talloc_destroy takes care of cleanup. */
+ return NULL; /* The TALLOC_FREE takes care of cleanup. */
}
ZERO_STRUCTP(l_new);
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);
+ TALLOC_FREE(l_ctx);
return False;
}
increment_lock_ref_count(fsp);
}
- talloc_destroy(l_ctx);
+ TALLOC_FREE(l_ctx);
return ret;
}
if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
DBG_ERR("unable to talloc unlock list.\n");
- talloc_destroy(ul_ctx);
+ TALLOC_FREE(ul_ctx);
return False;
}
if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_RDLCK)) {
DBG_ERR("downgrade of lock failed with error %s !\n",
strerror(errno));
- talloc_destroy(ul_ctx);
+ TALLOC_FREE(ul_ctx);
return False;
}
}
}
}
- talloc_destroy(ul_ctx);
+ TALLOC_FREE(ul_ctx);
return ret;
}
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);
+ TALLOC_FREE(ul_ctx);
return False;
}
if (!locks_exist_on_context(plocks, num_locks, lock_ctx)) {
decrement_posix_lock_count(fsp, lock_ctx->smblctx);
}
- talloc_destroy(ul_ctx);
+ TALLOC_FREE(ul_ctx);
return ret;
}
static void free_afs_acl(struct afs_acl *acl)
{
- if (acl->ctx != NULL)
- talloc_destroy(acl->ctx);
- acl->ctx = NULL;
+ TALLOC_FREE(acl->ctx);
acl->num_aces = 0;
acl->acelist = NULL;
}
ldap_value_free(values);
if (msg != NULL)
ldap_msgfree(msg);
- if (mem_ctx)
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return ntstatus;
}
pname,
&secdesc);
if (!W_ERROR_IS_OK(result)) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return WERR_NOT_ENOUGH_MEMORY;
}
parent_secdesc->group_sid,
false);
if (!NT_STATUS_IS_OK(status)) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return ntstatus_to_werror(status);
}
DEBUG(4, ("access check was %s\n", NT_STATUS_IS_OK(status) ? "SUCCESS" : "FAILURE"));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return ntstatus_to_werror(status);
}
result = tdb_traverse( tdb_printers, sec_desc_upg_fn, ctx );
- talloc_destroy( ctx );
+ TALLOC_FREE( ctx );
return ( result >= 0 );
}
result = tdb_traverse( tdb_printers, normalize_printers_fn, NULL );
- talloc_destroy( ctx );
+ TALLOC_FREE( ctx );
return ( result >= 0 );
}
/* free any talloc()'d memory */
if ( file && file->mem_ctx )
- talloc_destroy( file->mem_ctx );
+ TALLOC_FREE( file->mem_ctx );
}
/*******************************************************************
return;
if ( ctr->ctx )
- talloc_destroy(ctr->ctx);
+ TALLOC_FREE(ctr->ctx);
ZERO_STRUCTP(ctr);
if ((argc < 1) || (argc > 3)) {
printf("Usage: %s [rid|-d] [sec_info]\n", argv[0]);
printf("\tSpecify rid for security on user, -d for security on domain\n");
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return NT_STATUS_OK;
}
dcerpc_samr_Close(b, mem_ctx, &domain_pol, &result);
dcerpc_samr_Close(b, mem_ctx, &connect_pol, &result);
done:
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return status;
}
&info1);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", win_errstr(werror));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return false;
}
printf("ok\n");
&info2);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", win_errstr(werror));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return false;
}
printf("ok\n");
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return true;
}
printf("Security descriptors match\n");
done:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return result;
}
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);
+ TALLOC_FREE(mem_ctx);
return (-1);
}
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);
+ TALLOC_FREE(mem_ctx);
return (-1);
}
printf("starting eatest\n");
if (!torture_open_connection(&cli, 0)) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return False;
}
0x4044, 0, &fnum, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("open failed - %s\n", nt_errstr(status));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return False;
}
if (!NT_STATUS_IS_OK(status)) {
printf("ea_set of name %s failed - %s\n", ea_name,
nt_errstr(status));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return False;
}
}
if (!NT_STATUS_IS_OK(status)) {
printf("ea_set of name %s failed - %s\n", ea_name,
nt_errstr(status));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return False;
}
}
if (!NT_STATUS_IS_OK(status)) {
printf("ea_set of name %s failed - %s\n", ea_name,
nt_errstr(status));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return False;
}
}
correct = False;
}
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
if (!torture_close_connection(cli)) {
correct = False;
}
static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
/* Cleanup */
- talloc_destroy(mem_ctx);
- mem_ctx = NULL;
+ TALLOC_FREE(mem_ctx);
vfs->data = NULL;
vfs->data_size = 0;
return NT_STATUS_OK;
static NTSTATUS cmd_quit(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
/* Cleanup */
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
exit(0);
return NT_STATUS_OK; /* NOTREACHED */
ret = 0;
out:
- talloc_destroy(tmp_ctx);
+ TALLOC_FREE(tmp_ctx);
return ret;
}
out:
ads_msgfree(ads, res);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
dump_gplink(&gp_link);
out:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
}
out:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
}
out:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
dump_gpo(&gpo, 0);
out:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
!print_alias_memberships(mem_ctx, &global_sid_Builtin, &member))
return -1;
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
cli_shutdown(cli);
}
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
if (!c->msg_ctx) {
d_fprintf(stderr, _("Could not initialise message context. "
"Try running as root\n"));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
&info);
}
if (!NT_STATUS_IS_OK(status)) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
if (!NT_STATUS_IS_OK(status)) {
fprintf(stderr,"Join to domain '%s' is not valid: %s\n",
domain, nt_errstr(status));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
printf("Join to '%s' is OK\n",domain);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Couldn't connect to domain controller: %s\n",
nt_errstr(nt_status)));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
if (NT_STATUS_IS_ERR(result)) {
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (NT_STATUS_IS_ERR(result)) {
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
dom_list.domains[i].name.string);
if (!NT_STATUS_IS_OK(nt_status)) {
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
};
DEBUG(0, ("Couldn't properly close lsa policy handle. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
/* close lsarpc pipe and connection to IPC$ */
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Couldn't connect to domain controller: %s\n",
nt_errstr(nt_status)));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
if (NT_STATUS_IS_ERR(result)) {
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (NT_STATUS_IS_ERR(result)) {
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Couldn't properly close lsa policy handle. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise samr pipe. Error was %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Couldn't open SAMR policy handle. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (!NT_STATUS_IS_OK(result)) {
DEBUG(0, ("Couldn't open SAMR policy handle. Error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Couldn't open domain object. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (!NT_STATUS_IS_OK(result)) {
DEBUG(0, ("Couldn't open domain object. Error was %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
DEBUG(0, ("Couldn't enumerate accounts. Error was: %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
if (NT_STATUS_IS_ERR(result)) {
DEBUG(0, ("Couldn't enumerate accounts. Error was: %s\n",
nt_errstr(result)));
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
};
/* set opt_* variables to remote domain */
if (!strupper_m(str)) {
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return -1;
}
c->opt_workgroup = talloc_strdup(mem_ctx, str);
/* close samr pipe and connection to IPC$ */
cli_shutdown(cli);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return 0;
}
TALLOC_FREE(pipe_hnd);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return status;
}
data_blob_clear_free(&session_key[1]);
cli_shutdown(cli[0]);
cli_shutdown(cli[1]);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return success;
}
pi.c = c;
ret = process_share_list(info_fn, &pi);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
pi.c = c;
ret = process_share_list(info_fn, &pi);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return ret;
}
done:
gfree_all();
poptFreeContext(pc);
- talloc_destroy(ctx);
+ TALLOC_FREE(ctx);
return retval;
}
nt_status = NT_STATUS_OK;
done:
- if (filter) {
- talloc_destroy(filter);
- }
+ TALLOC_FREE(filter);
if (msg) {
ads_msgfree(ctx->ads, msg);
}
v_state);
SAFE_FREE(keystr);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
}
}
out:
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return result;
}
}
memcredp->username = talloc_strdup(memcredp, username);
if (!memcredp->username) {
- talloc_destroy(memcredp);
+ TALLOC_FREE(memcredp);
return NT_STATUS_NO_MEMORY;
}
status = store_memory_creds(memcredp, pass);
if (!NT_STATUS_IS_OK(status)) {
- talloc_destroy(memcredp);
+ TALLOC_FREE(memcredp);
return status;
}
if (memcredp->ref_count <= 0) {
delete_memory_creds(memcredp);
DLIST_REMOVE(memory_creds_list, memcredp);
- talloc_destroy(memcredp);
+ TALLOC_FREE(memcredp);
DEBUG(10,("winbindd_delete_memory_creds: "
"deleted entry for user %s\n",
username));
message = collect_onlinestatus(mem_ctx);
if (message == NULL) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return;
}
messaging_send_buf(msg_ctx, server_id, MSG_WINBIND_ONLINESTATUS,
(const uint8_t *)message, strlen(message) + 1);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
}
void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
message = NDR_PRINT_STRUCT_STRING(mem_ctx, winbindd_domain,
find_domain_from_name_noinit(domain));
if (!message) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return;
}
MSG_WINBIND_DUMP_DOMAIN_LIST,
(const uint8_t *)message, strlen(message) + 1);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return;
}
for (dom = domain_list(); dom; dom=dom->next) {
message = NDR_PRINT_STRUCT_STRING(mem_ctx, winbindd_domain, dom);
if (!message) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return;
}
s = talloc_asprintf_append(s, "%s\n", message);
if (!s) {
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
return;
}
}
nt_errstr(status)));
}
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
}
static void account_lockout_policy_handler(struct tevent_context *ctx,
char *description = talloc_describe_all(mem_ctx);
DEBUG(3, ("tallocs left:\n%s\n", description));
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(mem_ctx);
}
#endif
ret = true;
done:
- talloc_destroy(frame);
+ TALLOC_FREE(frame);
return ret;
}