Skip to content

Commit 7fb7509

Browse files
Merge pull request #8935 from philljj/fix_coverity
coverity: prune dead code in ssl_sess.c.
2 parents 5db7fc0 + 68cf96e commit 7fb7509

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/ssl_load.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5176,11 +5176,6 @@ int wolfSSL_add0_chain_cert(WOLFSSL* ssl, WOLFSSL_X509* x509)
51765176
/* Push X509 object onto stack to be freed. */
51775177
ret = wolfSSL_sk_X509_push(ssl->ourCertChain, x509) > 0
51785178
? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
5179-
if (ret != 1) {
5180-
/* Free it now on error. */
5181-
wolfSSL_X509_free(x509);
5182-
x509 = NULL;
5183-
}
51845179
}
51855180
}
51865181
return WS_RC(ret);

src/ssl_sess.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,9 +1178,6 @@ int wolfSSL_GetSessionFromCache(WOLFSSL* ssl, WOLFSSL_SESSION* output)
11781178
byte preallocNonceUsed = 0;
11791179
#endif /* WOLFSSL_TLS13 */
11801180
byte tmpBufSet = 0;
1181-
#endif
1182-
#if defined(SESSION_CERTS) && defined(OPENSSL_EXTRA)
1183-
WOLFSSL_X509* peer = NULL;
11841181
#endif
11851182
byte bogusID[ID_LEN];
11861183
byte bogusIDSz = 0;
@@ -1447,13 +1444,6 @@ int wolfSSL_GetSessionFromCache(WOLFSSL* ssl, WOLFSSL_SESSION* output)
14471444
XFREE(preallocNonce, output->heap, DYNAMIC_TYPE_SESSION_TICK);
14481445
#endif /* WOLFSSL_TLS13 && WOLFSSL_TICKET_NONCE_MALLOC && FIPS_VERSION_GE(5,3)*/
14491446

1450-
#endif
1451-
1452-
#if defined(SESSION_CERTS) && defined(OPENSSL_EXTRA)
1453-
if (peer != NULL) {
1454-
wolfSSL_X509_free(peer);
1455-
peer = NULL;
1456-
}
14571447
#endif
14581448

14591449
return error;

0 commit comments

Comments
 (0)