From 5b4b9ce976fce09a7a92e2f25b91a1635cb840fe Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 19 Jul 2012 12:48:02 +0000 Subject: [PATCH] Don't ignore (!) reference count in X509_STORE_free. --- crypto/x509/x509_lu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index 38525a8cdd..72121f6bec 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -238,6 +238,19 @@ void X509_STORE_free(X509_STORE *vfy) if (vfy == NULL) return; + i=CRYPTO_add(&vfy->references,-1,CRYPTO_LOCK_X509_STORE); +#ifdef REF_PRINT + REF_PRINT("X509_STORE",vfy); +#endif + if (i > 0) return; +#ifdef REF_CHECK + if (i < 0) + { + fprintf(stderr,"X509_STORE_free, bad reference count\n"); + abort(); /* ok */ + } +#endif + sk=vfy->get_cert_methods; for (i=0; i