您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ talloc_destroy函数代码示例

51自学网 2021-06-03 08:39:46
  C++
这篇教程C++ talloc_destroy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中talloc_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ talloc_destroy函数的具体用法?C++ talloc_destroy怎么用?C++ talloc_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了talloc_destroy函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: msg_pool_usage

/** * Respond to a POOL_USAGE message by sending back string form of memory * usage stats. **/static void msg_pool_usage(struct messaging_context *msg_ctx,			   void *private_data, 			   uint32_t msg_type, 			   struct server_id src,			   DATA_BLOB *data){	struct msg_pool_usage_state state;	SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE);		DEBUG(2,("Got POOL_USAGE/n"));	state.mem_ctx = talloc_init("msg_pool_usage");	if (!state.mem_ctx) {		return;	}	state.len	= 0;	state.buflen	= 512;	state.s		= NULL;	talloc_report_depth_cb(NULL, 0, -1, msg_pool_usage_helper, &state);	if (!state.s) {		talloc_destroy(state.mem_ctx);		return;	}		messaging_send_buf(msg_ctx, src, MSG_POOL_USAGE,			   (uint8 *)state.s, strlen(state.s)+1);	talloc_destroy(state.mem_ctx);}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:36,


示例2: msg_pool_usage

/** * Respond to a POOL_USAGE message by sending back string form of memory * usage stats. **/void msg_pool_usage(int msg_type, struct process_id src_pid,		    void *UNUSED(buf), size_t UNUSED(len),		    void *private_data){	struct msg_pool_usage_state state;	SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE);		DEBUG(2,("Got POOL_USAGE/n"));	state.mem_ctx = talloc_init("msg_pool_usage");	if (!state.mem_ctx) {		return;	}	state.len	= 0;	state.buflen	= 512;	state.s		= NULL;	talloc_report_depth_cb(NULL, 0, -1, msg_pool_usage_helper, &state);	if (!state.s) {		talloc_destroy(state.mem_ctx);		return;	}		message_send_pid(src_pid, MSG_POOL_USAGE,			 state.s, strlen(state.s)+1, True);	talloc_destroy(state.mem_ctx);}
开发者ID:AllardJ,项目名称:Tomato,代码行数:34,


示例3: net_ads_workgroup

/*    determine the netbios workgroup name for a domain */static int net_ads_workgroup(int argc, const char **argv){	ADS_STRUCT *ads;	TALLOC_CTX *ctx;	const char *workgroup;	if (!(ads = ads_startup())) return -1;	if (!(ctx = talloc_init("net_ads_workgroup"))) {		ads_destroy(&ads);		return -1;	}	if (!ADS_ERR_OK(ads_workgroup_name(ads, ctx, &workgroup))) {		d_printf("Failed to find workgroup for realm '%s'/n", 			 ads->config.realm);		talloc_destroy(ctx);		ads_destroy(&ads);		return -1;	}	d_printf("Workgroup: %s/n", workgroup);	talloc_destroy(ctx);	ads_destroy(&ads);	return 0;}
开发者ID:niubl,项目名称:camera_project,代码行数:30,


示例4: enum_local_groups

static NTSTATUS enum_local_groups(struct winbindd_domain *domain,				TALLOC_CTX *mem_ctx,				uint32 *num_entries, 				struct acct_info **info){	uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;	CLI_POLICY_HND *hnd;	POLICY_HND dom_pol;	NTSTATUS result;	int retry;	*num_entries = 0;	*info = NULL;	retry = 0;	do {		if ( !NT_STATUS_IS_OK(result = cm_get_sam_handle(domain, &hnd)) )			return result;		result = cli_samr_open_domain( hnd->cli, mem_ctx, &hnd->pol, 						des_access, &domain->sid, &dom_pol);	} while (!NT_STATUS_IS_OK(result) && (retry++ < 1) && hnd && hnd->cli && hnd->cli->fd == -1);	if ( !NT_STATUS_IS_OK(result))		return result;	do {		struct acct_info *info2 = NULL;		uint32 count = 0, start = *num_entries;		TALLOC_CTX *mem_ctx2;		mem_ctx2 = talloc_init("enum_dom_local_groups[rpc]");		result = cli_samr_enum_als_groups( hnd->cli, mem_ctx2, &dom_pol,					  &start, 0xFFFF, &info2, &count);					  		if ( !NT_STATUS_IS_OK(result) 			&& !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES) ) 		{			talloc_destroy(mem_ctx2);			break;		}		(*info) = talloc_realloc(mem_ctx, *info, 					 sizeof(**info) * ((*num_entries) + count));		if (! *info) {			talloc_destroy(mem_ctx2);			cli_samr_close(hnd->cli, mem_ctx, &dom_pol);			return NT_STATUS_NO_MEMORY;		}		memcpy(&(*info)[*num_entries], info2, count*sizeof(*info2));		(*num_entries) += count;		talloc_destroy(mem_ctx2);	} while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));	cli_samr_close(hnd->cli, mem_ctx, &dom_pol);	return result;}
开发者ID:niubl,项目名称:camera_project,代码行数:60,


示例5: atalk_rmdir

static int atalk_rmdir(struct vfs_handle_struct *handle,			const struct smb_filename *smb_fname){	bool add = False;	TALLOC_CTX *ctx = 0;	const char *path = smb_fname->base_name;	char *dpath;	if (!handle->conn->cwd || !path) goto exit_rmdir;	/* due to there is no way to change bDeleteVetoFiles variable	 * from this module, gotta use talloc stuff..	 */	strstr_m(path, APPLEDOUBLE) ? (add = False) : (add = True);	if (!(ctx = talloc_init("remove_directory")))		goto exit_rmdir;	if (!(dpath = talloc_asprintf(ctx, "%s/%s%s", 	  handle->conn->cwd, path, add ? "/"APPLEDOUBLE : "")))		goto exit_rmdir;	atalk_rrmdir(ctx, dpath);exit_rmdir:	talloc_destroy(ctx);	return SMB_VFS_NEXT_RMDIR(handle, smb_fname);}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:29,


示例6: atalk_chmod

static int atalk_chmod(struct vfs_handle_struct *handle, const char *path, mode_t mode){	int ret = 0;	char *adbl_path = 0;	char *orig_path = 0;	SMB_STRUCT_STAT adbl_info;	SMB_STRUCT_STAT orig_info;	TALLOC_CTX *ctx;	ret = SMB_VFS_NEXT_CHMOD(handle, path, mode);	if (!path) return ret;	if (!(ctx = talloc_init("chmod_file")))		return ret;	if (atalk_build_paths(ctx, handle->conn->origpath, path, &adbl_path,			      &orig_path, &adbl_info, &orig_info,			      false) != 0)		goto exit_chmod;	if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {		DEBUG(3, ("ATALK: %s has passed../n", orig_path));				goto exit_chmod;	}	chmod(adbl_path, ADOUBLEMODE);exit_chmod:		talloc_destroy(ctx);	return ret;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:32,


示例7: main_loop_TALLOC_FREE

void main_loop_TALLOC_FREE(void){    if (!main_loop_talloc)        return;    talloc_destroy(main_loop_talloc);    main_loop_talloc = NULL;}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:7,


示例8: DEBUG

struct _FAKE_FILE_HANDLE *init_fake_file_handle(enum FAKE_FILE_TYPE type){    TALLOC_CTX *mem_ctx = NULL;    FAKE_FILE_HANDLE *fh = NULL;    int i;    for (i=0; fake_files[i].name!=NULL; i++) {        if (fake_files[i].type==type) {            DEBUG(5,("init_fake_file_handle: for [%s]/n",fake_files[i].name));            if ((mem_ctx=talloc_init("fake_file_handle"))==NULL) {                DEBUG(0,("talloc_init(fake_file_handle) failed./n"));                return NULL;            }            if ((fh =TALLOC_ZERO_P(mem_ctx, FAKE_FILE_HANDLE))==NULL) {                DEBUG(0,("talloc_zero() failed./n"));                talloc_destroy(mem_ctx);                return NULL;            }            fh->type = type;            fh->mem_ctx = mem_ctx;            if (fake_files[i].init_pd)                fh->pd = fake_files[i].init_pd(fh->mem_ctx);            fh->free_pd = fake_files[i].free_pd;            return fh;        }    }    return NULL;}
开发者ID:hajuuk,项目名称:R7000,代码行数:35,


示例9: PyErr_SetString

static PyObject *samr_delete_dom_user(PyObject *self, PyObject *args, 				      PyObject *kw){	samr_user_hnd_object *user_hnd = (samr_user_hnd_object *)self;	static char *kwlist[] = { NULL };	NTSTATUS ntstatus;	TALLOC_CTX *mem_ctx;	PyObject *result = NULL;		if (!PyArg_ParseTupleAndKeywords(		    args, kw, "", kwlist))		return NULL;	if (!(mem_ctx = talloc_init("samr_delete_dom_user"))) {		PyErr_SetString(samr_error, "unable to init talloc context");		return NULL;	}	ntstatus = rpccli_samr_delete_dom_user(		user_hnd->cli, mem_ctx, &user_hnd->user_pol);	if (!NT_STATUS_IS_OK(ntstatus)) {		PyErr_SetObject(samr_ntstatus, py_ntstatus_tuple(ntstatus));		goto done;	}	Py_INCREF(Py_None);	result = Py_None;done:	talloc_destroy(mem_ctx);	return result;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:34,


示例10: atalk_lchown

static int atalk_lchown(struct vfs_handle_struct *handle,			const struct smb_filename *smb_fname,			uid_t uid,			gid_t gid){	int ret = 0;	char *adbl_path = 0;	char *orig_path = 0;	SMB_STRUCT_STAT adbl_info;	SMB_STRUCT_STAT orig_info;	TALLOC_CTX *ctx;	ret = SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid);	if (!(ctx = talloc_init("lchown_file")))		return ret;	if (atalk_build_paths(ctx, handle->conn->cwd, smb_fname->base_name,			      &adbl_path, &orig_path,			      &adbl_info, &orig_info) != 0)		goto exit_lchown;	if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {		DEBUG(3, ("ATALK: %s has passed../n", orig_path));				goto exit_lchown;	}	if (lchown(adbl_path, uid, gid) == -1) {		DEBUG(3, ("ATALK: lchown error %s/n", strerror(errno)));	}exit_lchown:		talloc_destroy(ctx);	return ret;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:35,


示例11: auth_ntlmssp_start

NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state){	NTSTATUS nt_status;	TALLOC_CTX *mem_ctx;	mem_ctx = talloc_init("AUTH NTLMSSP context");		*auth_ntlmssp_state = TALLOC_ZERO_P(mem_ctx, AUTH_NTLMSSP_STATE);	if (!*auth_ntlmssp_state) {		DEBUG(0,("auth_ntlmssp_start: talloc failed!/n"));		talloc_destroy(mem_ctx);		return NT_STATUS_NO_MEMORY;	}	ZERO_STRUCTP(*auth_ntlmssp_state);	(*auth_ntlmssp_state)->mem_ctx = mem_ctx;	if (!NT_STATUS_IS_OK(nt_status = ntlmssp_server_start(&(*auth_ntlmssp_state)->ntlmssp_state))) {		return nt_status;	}	if (!NT_STATUS_IS_OK(nt_status = make_auth_context_subsystem(&(*auth_ntlmssp_state)->auth_context))) {		return nt_status;	}	(*auth_ntlmssp_state)->ntlmssp_state->auth_context = (*auth_ntlmssp_state);	(*auth_ntlmssp_state)->ntlmssp_state->get_challenge = auth_ntlmssp_get_challenge;	(*auth_ntlmssp_state)->ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;	(*auth_ntlmssp_state)->ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;	(*auth_ntlmssp_state)->ntlmssp_state->check_password = auth_ntlmssp_check_password;	(*auth_ntlmssp_state)->ntlmssp_state->server_role = (enum server_types)lp_server_role();	return NT_STATUS_OK;}
开发者ID:endisd,项目名称:samba,代码行数:35,


示例12: ntlmssp_client_start

NTSTATUS ntlmssp_client_start(NTLMSSP_STATE **ntlmssp_state){	*ntlmssp_state = TALLOC_ZERO_P(NULL, NTLMSSP_STATE);	if (!*ntlmssp_state) {		DEBUG(0,("ntlmssp_client_start: talloc failed!/n"));		talloc_destroy(*ntlmssp_state);		return NT_STATUS_NO_MEMORY;	}	(*ntlmssp_state)->role = NTLMSSP_CLIENT;	(*ntlmssp_state)->get_global_myname = global_myname;	(*ntlmssp_state)->get_domain = lp_workgroup;	(*ntlmssp_state)->unicode = True;	(*ntlmssp_state)->use_ntlmv2 = lp_client_ntlmv2_auth();	(*ntlmssp_state)->expected_state = NTLMSSP_INITIAL;	(*ntlmssp_state)->ref_count = 1;	(*ntlmssp_state)->neg_flags = 		NTLMSSP_NEGOTIATE_128 |		NTLMSSP_NEGOTIATE_ALWAYS_SIGN |		NTLMSSP_NEGOTIATE_NTLM |		NTLMSSP_NEGOTIATE_NTLM2 |		NTLMSSP_NEGOTIATE_KEY_EXCH |		NTLMSSP_REQUEST_TARGET;	return NT_STATUS_OK;}
开发者ID:berte,项目名称:mediaplayer,代码行数:32,


示例13: atalk_chown

static int atalk_chown(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, uid_t uid, gid_t gid){	int ret = 0;	char *adbl_path = 0;	char *orig_path = 0;	SMB_STRUCT_STAT adbl_info;	SMB_STRUCT_STAT orig_info;	TALLOC_CTX *ctx;	ret = SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid);	if (!conn || !path) return ret;	if (!(ctx = talloc_init("chown_file")))		return ret;	if (atalk_build_paths(ctx, conn->origpath, path, &adbl_path, &orig_path,	  &adbl_info, &orig_info) != 0)		return ret;	if (!S_ISDIR(orig_info.st_mode) && !S_ISREG(orig_info.st_mode)) {		DEBUG(3, ("ATALK: %s has passed../n", orig_path));				goto exit_chown;	}	chown(adbl_path, uid, gid);exit_chown:		talloc_destroy(ctx);	return ret;}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:31,


示例14: atalk_rename

static int atalk_rename(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldname, const char *newname){	int ret = 0;	char *adbl_path = 0;	char *orig_path = 0;	SMB_STRUCT_STAT adbl_info;	SMB_STRUCT_STAT orig_info;	TALLOC_CTX *ctx;	ret = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname);	if (!conn || !oldname) return ret;	if (!(ctx = talloc_init("rename_file")))		return ret;	if (atalk_build_paths(ctx, conn->origpath, oldname, &adbl_path, &orig_path, 	  &adbl_info, &orig_info) != 0)		return ret;	if (S_ISDIR(orig_info.st_mode) || S_ISREG(orig_info.st_mode)) {		DEBUG(3, ("ATALK: %s has passed../n", adbl_path));				goto exit_rename;	}	atalk_unlink_file(adbl_path);exit_rename:	talloc_destroy(ctx);	return ret;}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:31,


示例15: share_access_check

BOOL share_access_check(const NT_USER_TOKEN *token, const char *sharename,			uint32 desired_access){	uint32 granted;	NTSTATUS status;	TALLOC_CTX *mem_ctx = NULL;	SEC_DESC *psd = NULL;	size_t sd_size;	BOOL ret = True;	if (!(mem_ctx = talloc_init("share_access_check"))) {		return False;	}	psd = get_share_security(mem_ctx, sharename, &sd_size);	if (!psd) {		TALLOC_FREE(mem_ctx);		return True;	}	ret = se_access_check(psd, token, desired_access, &granted, &status);	talloc_destroy(mem_ctx);	return ret;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:26,


示例16: net_groupmap_memberships

static int net_groupmap_memberships(struct net_context *c, int argc, const char **argv){	TALLOC_CTX *mem_ctx;	struct dom_sid *domain_sid, member;	if ( (argc != 1) ||	     c->display_usage ||	     !string_to_sid(&member, argv[0]) ) {		d_printf("%s/n%s",			 _("Usage:"),			 _("net groupmap memberships sid/n"));		return -1;	}	mem_ctx = talloc_init("net_groupmap_memberships");	if (mem_ctx == NULL) {		d_fprintf(stderr, _("talloc_init failed/n"));		return -1;	}	domain_sid = get_global_sam_sid();	if (domain_sid == NULL) {		d_fprintf(stderr, _("Could not get domain sid/n"));		return -1;	}	if (!print_alias_memberships(mem_ctx, domain_sid, &member) ||	    !print_alias_memberships(mem_ctx, &global_sid_Builtin, &member))		return -1;	talloc_destroy(mem_ctx);	return 0;}
开发者ID:srimalik,项目名称:samba,代码行数:34,


示例17: atalk_rmdir

static int atalk_rmdir(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path){	BOOL add = False;	TALLOC_CTX *ctx = 0;	char *dpath;	if (!conn || !conn->origpath || !path) goto exit_rmdir;	/* due to there is no way to change bDeleteVetoFiles variable	 * from this module, gotta use talloc stuff..	 */	strstr(path, APPLEDOUBLE) ? (add = False) : (add = True);	if (!(ctx = talloc_init("remove_directory")))		goto exit_rmdir;	if (!(dpath = talloc_asprintf(ctx, "%s/%s%s", 	  conn->origpath, path, add ? "/"APPLEDOUBLE : "")))		goto exit_rmdir;	atalk_rrmdir(ctx, dpath);exit_rmdir:	talloc_destroy(ctx);	return SMB_VFS_NEXT_RMDIR(handle, conn, path);}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:27,


示例18: net_sh_run

static NTSTATUS net_sh_run(struct net_context *c,			   struct rpc_sh_ctx *ctx, struct rpc_sh_cmd *cmd,			   int argc, const char **argv){	TALLOC_CTX *mem_ctx;	struct rpc_pipe_client *pipe_hnd = NULL;	NTSTATUS status;	mem_ctx = talloc_new(ctx);	if (mem_ctx == NULL) {		d_fprintf(stderr, _("talloc_new failed/n"));		return NT_STATUS_NO_MEMORY;	}	status = cli_rpc_pipe_open_noauth(ctx->cli, &cmd->table->syntax_id,					  &pipe_hnd);	if (!NT_STATUS_IS_OK(status)) {		d_fprintf(stderr, _("Could not open pipe: %s/n"),			  nt_errstr(status));		return status;	}	status = cmd->fn(c, mem_ctx, ctx, pipe_hnd, argc, argv);	TALLOC_FREE(pipe_hnd);	talloc_destroy(mem_ctx);	return status;}
开发者ID:andrew-aladev,项目名称:samba-talloc-debug,代码行数:30,


示例19: destroy_privilege

void destroy_privilege(PRIVILEGE_SET **priv_set){	reset_privilege(*priv_set);	if (!((*priv_set)->ext_ctx))		/* mem_ctx is local, destroy it */		talloc_destroy((*priv_set)->mem_ctx);	*priv_set = NULL;}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:8,


示例20: free_afs_acl

static void free_afs_acl(struct afs_acl *acl){	if (acl->ctx != NULL)		talloc_destroy(acl->ctx);	acl->ctx = NULL;	acl->num_aces = 0;	acl->acelist = NULL;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:8,


示例21: cmd_quit

static NTSTATUS cmd_quit(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv){	/* Cleanup */	talloc_destroy(mem_ctx);	exit(0);	return NT_STATUS_OK; /* NOTREACHED */}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:8,


示例22: main

int main(int argc, char **argv) {   CacServerHandle *hnd = NULL;   TALLOC_CTX *mem_ctx = NULL;   struct SamOpenUser ou;   fstring tmp;   mem_ctx = talloc_init("cac_samgroup");   hnd = cac_NewServerHandle(True);   cac_SetAuthDataFn(hnd, cactest_GetAuthDataFn);   cac_parse_cmd_line(argc, argv, hnd);   if(!cac_Connect(hnd, NULL)) {      fprintf(stderr, "Could not connect to server %s. Error: %s/n", hnd->server, nt_errstr(hnd->status));      exit(-1);   }   struct SamOpenDomain sod;   ZERO_STRUCT(sod);   sod.in.access = MAXIMUM_ALLOWED_ACCESS;    if(!cac_SamOpenDomain(hnd, mem_ctx, &sod)) {      fprintf(stderr, "Could not open domain. Error: %s/n", nt_errstr(hnd->status));      goto done;   }   ZERO_STRUCT(ou);   printf("Enter username: ");   cactest_readline(stdin, tmp);   ou.in.name = talloc_strdup(mem_ctx, tmp);   ou.in.access = MAXIMUM_ALLOWED_ACCESS;   ou.in.dom_hnd = sod.out.dom_hnd;   if(!cac_SamOpenUser(hnd, mem_ctx, &ou)) {      fprintf(stderr, "Could not open user. Error: %s/n", nt_errstr(hnd->status));      goto done;   }   /*enable the user*/   if(!cac_SamEnableUser(hnd, mem_ctx, ou.out.user_hnd)) {      fprintf(stderr, "Could not enable user: %s/n", nt_errstr(hnd->status));   }done:   cac_SamClose(hnd, mem_ctx, sod.out.dom_hnd);   cac_FreeHandle(hnd);   talloc_destroy(mem_ctx);      return 0;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:58,


示例23: cmd_freemem

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;	vfs->data = NULL;	vfs->data_size = 0;	return NT_STATUS_OK;}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:9,


示例24: cell_destroy

 void cell_destroy(struct likewise_cell *c){	if (!c)		return;	if (c->conn)		ads_destroy(&c->conn);	talloc_destroy(c);}
开发者ID:Arkhont,项目名称:samba,代码行数:10,


示例25: privilege_set_free

void privilege_set_free(PRIVILEGE_SET *priv_set){	if ( !priv_set )		return;	if ( !( priv_set->ext_ctx ) )		talloc_destroy( priv_set->mem_ctx );	ZERO_STRUCTP( priv_set );}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:10,


示例26: atalk_unlink

static int atalk_unlink(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path){	int ret = 0, i;	char *adbl_path = 0;	char *orig_path = 0;	SMB_STRUCT_STAT adbl_info;	SMB_STRUCT_STAT orig_info;	TALLOC_CTX *ctx;	ret = SMB_VFS_NEXT_UNLINK(handle, conn, path);	if (!conn || !path) return ret;	/* no .AppleDouble sync if veto or hide list is empty,	 * otherwise "Cannot find the specified file" error will be caused	 */	if (!conn->veto_list) return ret;	if (!conn->hide_list) return ret;	for (i = 0; conn->veto_list[i].name; i ++) {		if (strstr(conn->veto_list[i].name, APPLEDOUBLE))			break;	}	if (!conn->veto_list[i].name) {		for (i = 0; conn->hide_list[i].name; i ++) {			if (strstr(conn->hide_list[i].name, APPLEDOUBLE))				break;			else {				DEBUG(3, ("ATALK: %s is not hidden, skipped../n",				  APPLEDOUBLE));						return ret;			}		}	}	if (!(ctx = talloc_init("unlink_file")))		return ret;	if (atalk_build_paths(ctx, conn->origpath, path, &adbl_path, &orig_path, 	  &adbl_info, &orig_info) != 0)		return ret;	if (S_ISDIR(orig_info.st_mode) || S_ISREG(orig_info.st_mode)) {		DEBUG(3, ("ATALK: %s has passed../n", adbl_path));		goto exit_unlink;	}	atalk_unlink_file(adbl_path);exit_unlink:		talloc_destroy(ctx);	return ret;}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:55,


示例27: destroy_fake_file_handle

void destroy_fake_file_handle(FAKE_FILE_HANDLE **fh){    if (!fh||!(*fh))        return;    if ((*fh)->free_pd)        (*fh)->free_pd(&(*fh)->pd);    talloc_destroy((*fh)->mem_ctx);    (*fh) = NULL;}
开发者ID:hajuuk,项目名称:R7000,代码行数:11,


示例28: free_ntquota_list

void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list){	if (!qt_list)		return;	if ((*qt_list)->mem_ctx)		talloc_destroy((*qt_list)->mem_ctx);	(*qt_list) = NULL;	return;	}
开发者ID:AllardJ,项目名称:Tomato,代码行数:12,


示例29: update_trustdom_cache

void update_trustdom_cache( void ){	char **domain_names;	struct dom_sid *dom_sids;	uint32 num_domains;	uint32 last_check;	int time_diff;	TALLOC_CTX *mem_ctx = NULL;	time_t now = time(NULL);	int i;	/* get the timestamp.  We have to initialise it if the last timestamp == 0 */		if ( (last_check = trustdom_cache_fetch_timestamp()) == 0 ) 		trustdom_cache_store_timestamp(0, now+TRUSTDOM_UPDATE_INTERVAL);	time_diff = (int) (now - last_check);	if ( (time_diff > 0) && (time_diff < TRUSTDOM_UPDATE_INTERVAL) ) {		DEBUG(10,("update_trustdom_cache: not time to update trustdom_cache yet/n"));		return;	}	/* note that we don't lock the timestamp. This prevents this	   smbd from blocking all other smbd daemons while we	   enumerate the trusted domains */	trustdom_cache_store_timestamp(now, now+TRUSTDOM_UPDATE_INTERVAL);	if ( !(mem_ctx = talloc_init("update_trustdom_cache")) ) {		DEBUG(0,("update_trustdom_cache: talloc_init() failed!/n"));		goto done;	}	/* get the domains and store them */	if ( enumerate_domain_trusts(mem_ctx, lp_workgroup(), &domain_names, 		&num_domains, &dom_sids)) {		for ( i=0; i<num_domains; i++ ) {			trustdom_cache_store( domain_names[i], NULL, &dom_sids[i], 				now+TRUSTDOM_UPDATE_INTERVAL);		}			} else {		/* we failed to fetch the list of trusted domains - restore the old		   timestamp */		trustdom_cache_store_timestamp(last_check, 					       last_check+TRUSTDOM_UPDATE_INTERVAL);	}done:		talloc_destroy( mem_ctx );	return;}
开发者ID:andrew-aladev,项目名称:samba-talloc-debug,代码行数:52,



注:本文中的talloc_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ talloc_free函数代码示例
C++ talloc_autofree_context函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。