Exemple #1
0
NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
{
	if (!ctx) {
		return NET_API_STATUS_SUCCESS;
	}

	libnetapi_samr_free(ctx);

	libnetapi_shutdown_cm(ctx);

	if (ctx->krb5_cc_env) {
		char *env = getenv(KRB5_ENV_CCNAME);
		if (env && (strequal(ctx->krb5_cc_env, env))) {
			unsetenv(KRB5_ENV_CCNAME);
		}
	}

	gfree_names();
	gfree_loadparm();
	gfree_case_tables();
	gfree_charcnv();
	gfree_interfaces();

	gencache_shutdown();
	secrets_shutdown();

	TALLOC_FREE(ctx);
	TALLOC_FREE(frame);

	gfree_debugsyms();

	return NET_API_STATUS_SUCCESS;
}
Exemple #2
0
NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
{
	TALLOC_CTX *frame;

	if (!ctx) {
		return NET_API_STATUS_SUCCESS;
	}

	frame = talloc_stackframe();
	libnetapi_samr_free(ctx);

	libnetapi_shutdown_cm(ctx);

	if (ctx->krb5_cc_env) {
		char *env = getenv(KRB5_ENV_CCNAME);
		if (env && (strequal(ctx->krb5_cc_env, env))) {
			unsetenv(KRB5_ENV_CCNAME);
		}
	}

	gfree_names();
	gfree_loadparm();
	gfree_charcnv();
	gfree_interfaces();

	secrets_shutdown();

	if (ctx == stat_ctx) {
		stat_ctx = NULL;
	}
	TALLOC_FREE(ctx);

	gfree_debugsyms();
	talloc_free(frame);

	return NET_API_STATUS_SUCCESS;
}