Commit 82bf227e authored by Richard Levitte's avatar Richard Levitte
Browse files

After objects have been freed, NULLify the pointers so there will be no double

free of those objects
parent 8807a2df
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1598,9 +1598,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);
	if (ctx->param != NULL)
		{
		X509_VERIFY_PARAM_free(ctx->param);
	if (ctx->tree)
		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);