Fix a memory leak in an error path

Found by Coverity

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6373)
This commit is contained in:
Matt Caswell 2018-05-29 16:05:10 +01:00
parent 28c73b34df
commit bdd5f12ea6

View File

@ -201,6 +201,7 @@ static int psk_use_session_cb(SSL *s, const EVP_MD *md,
cipher = SSL_CIPHER_find(s, tls13_aes128gcmsha256_id);
if (cipher == NULL) {
BIO_printf(bio_err, "Error finding suitable ciphersuite\n");
OPENSSL_free(key);
return 0;
}