Sorry about these crashes, it seems I have been too greedy freeing
memory. Can you try the following diff, which should fix the issue?

Index: x509/x509_lu.c
===================================================================
RCS file: /cvs/src/lib/libcrypto/x509/x509_lu.c,v
retrieving revision 1.21
diff -u -p -r1.21 x509_lu.c
--- x509/x509_lu.c      8 Nov 2016 21:22:55 -0000       1.21
+++ x509/x509_lu.c      12 Nov 2016 09:37:12 -0000
@@ -376,8 +376,10 @@ X509_STORE_add_cert(X509_STORE *ctx, X50
 
        CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
 
-       if (ret == 0)
+       if (ret == 0) {
+               obj->data.x509 = NULL; /* owned by the caller */
                X509_OBJECT_free(obj);
+       }
 
        return ret;
 }
@@ -419,8 +421,10 @@ X509_STORE_add_crl(X509_STORE *ctx, X509
 
        CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
 
-       if (ret == 0)
+       if (ret == 0) {
+               obj->data.crl = NULL; /* owned by the caller */
                X509_OBJECT_free(obj);
+       }
 
        return ret;
 }

Reply via email to