From: Dave Wallace Date: Fri, 12 Sep 2025 14:39:26 +0000 (-0400) Subject: tls: fix memory leak when using test cert X-Git-Tag: v26.02-rc0~36 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=0dbd3725a2939f904b85213c41d72d768b02c6f9;p=vpp.git tls: fix memory leak when using test cert Type: fix Change-Id: I4bf4c6c37f9ee6e262730c372f16fbc086a2d13c Signed-off-by: Dave Wallace --- diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c index 6ccb17f7391..9648d6f66f9 100644 --- a/src/plugins/tlsopenssl/tls_openssl.c +++ b/src/plugins/tlsopenssl/tls_openssl.c @@ -1438,12 +1438,14 @@ tls_init_ca_chain (void) cert_bio = BIO_new (BIO_s_mem ()); BIO_write (cert_bio, test_srv_crt_rsa, test_srv_crt_rsa_len); testcert = PEM_read_bio_X509 (cert_bio, NULL, NULL, NULL); + BIO_free (cert_bio); if (!testcert) { clib_warning ("unable to parse certificate"); return -1; } X509_STORE_add_cert (om->cert_store, testcert); + X509_free (testcert); rv = 0; } return (rv < 0 ? -1 : 0);