1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

Fix crash bug when strequal is used too late in libnetapi_free.

Guenther
(This used to be commit ba2b8a310e)
This commit is contained in:
Günther Deschner
2008-01-08 11:49:35 +01:00
parent c6576503c9
commit ab216a1b4e

View File

@ -103,6 +103,14 @@ NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx)
NET_API_STATUS libnetapi_free(struct libnetapi_ctx *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();
@ -113,11 +121,6 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
secrets_shutdown();
regdb_close();
if (ctx->krb5_cc_env &&
(strequal(ctx->krb5_cc_env, getenv(KRB5_ENV_CCNAME)))) {
unsetenv(KRB5_ENV_CCNAME);
}
TALLOC_FREE(ctx);
TALLOC_FREE(frame);