summaryrefslogtreecommitdiffstats
path: root/test/helpers/handshake.c
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-25 12:57:37 +1000
committerPauli <pauli@openssl.org>2021-06-26 11:33:52 +1000
commit711d5a2fc0d611d5574c6d81b9cc0aa1564d2d2a (patch)
tree9e854355de37a20482e70b0fc4579ada28983aa0 /test/helpers/handshake.c
parent1f25fd161698e7b93d43872735793b084f2d92af (diff)
test: avoid memory leaks on errors
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/15910)
Diffstat (limited to 'test/helpers/handshake.c')
-rw-r--r--test/helpers/handshake.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c
index 0543634c73..d44aa4baaf 100644
--- a/test/helpers/handshake.c
+++ b/test/helpers/handshake.c
@@ -278,8 +278,10 @@ static int server_ocsp_cb(SSL *s, void *arg)
* For the purposes of testing we just send back a dummy OCSP response
*/
*resp = *(unsigned char *)arg;
- if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1))
+ if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1)) {
+ OPENSSL_free(resp);
return SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
return SSL_TLSEXT_ERR_OK;
}