diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index b23c219e8..ebcc54536 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -2538,7 +2538,6 @@ static int tls_parse_pkcs12(struct tls_data *data, SSL *ssl, PKCS12 *p12,
 				res = -1;
 				break;
 			}
-			X509_free(cert);
 		}
 		sk_X509_pop_free(certs, X509_free);
 #endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */