diff options
author | Richard Levitte <levitte@openssl.org> | 2007-02-07 01:42:46 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2007-02-07 01:42:46 +0000 |
commit | 82bf227e9170e144ca143af3d4b970c1500d0884 (patch) | |
tree | a7d05756fdb1c7d23fdd4a1c7111fe7912d71ee9 /crypto/x509 | |
parent | 8807a2dfc417e332abeaa23a3a885917ce88425b (diff) |
After objects have been freed, NULLify the pointers so there will be no double
free of those objects
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509_vfy.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index d8ed30a9e8..ba2c3836f5 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -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); - 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); |