Fixed memory leak when in certificate chain.