v3: - add patch properly releasing existing certificate in add_cert_to_store().
After removing dead code in the previous update I got curious if that code was actually intended to do something and found that refcounting issue on adding cert to store when existing cert is in play (the modified test with cert.c properly shows leaked reference without the changes). I believe doing any refcounting on 'existing' cert in MemStore_addContext() would be wrong, the store doesn't hold references to stored objects. That seems to be already correctly handled in CertAddCTLContextToStore() and CertAddCRLContextToStore().