Skip to content

Commit 68cf96e

Browse files
committed
coverity: do not free x509 on error in wolfSSL_add0_chain_cert.
1 parent d998d01 commit 68cf96e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/ssl_load.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5108,11 +5108,6 @@ int wolfSSL_add0_chain_cert(WOLFSSL* ssl, WOLFSSL_X509* x509)
51085108
/* Push X509 object onto stack to be freed. */
51095109
ret = wolfSSL_sk_X509_push(ssl->ourCertChain, x509) > 0
51105110
? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
5111-
if (ret != 1) {
5112-
/* Free it now on error. */
5113-
wolfSSL_X509_free(x509);
5114-
x509 = NULL;
5115-
}
51165111
}
51175112
}
51185113
return WS_RC(ret);

0 commit comments

Comments
 (0)