From: Richard Levitte Date: Wed, 7 Feb 2007 01:42:51 +0000 (+0000) Subject: After objects have been freed, NULLify the pointers so there will be no double X-Git-Tag: OpenSSL_0_9_8e~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=53707e2eec653f5ed33cd84b128e8177bd211e11;p=oweals%2Fopenssl.git After objects have been freed, NULLify the pointers so there will be no double free of those objects --- diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index ac52991fc2..07df21f6b9 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -1468,9 +1468,16 @@ void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) { if (ctx->cleanup) ctx->cleanup(ctx); - X509_VERIFY_PARAM_free(ctx->param); - if (ctx->tree) + if (ctx->param != NULL) + { + X509_VERIFY_PARAM_free(ctx->param); + ctx->param=NULL; + } + if (ctx->tree != NULL) + { X509_policy_tree_free(ctx->tree); + ctx->tree=NULL; + } if (ctx->chain != NULL) { sk_X509_pop_free(ctx->chain,X509_free);