summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-27 14:22:20 +0100
committerMatt Caswell <matt@openssl.org>2016-04-28 13:13:09 +0100
commitb3bd3d5af8ed31f438db4367ce3a4bd43067e764 (patch)
treec6c59005d40059a215bfefe956da8ff6259b26c3 /ssl/ssl_lib.c
parent34b9acbd3f81b46967f692c0af49020c8c405746 (diff)
Don't leak memory on error path in dane_ctx_enable()
The function dane_ctx_enable() allocated some memory that it did not free in an error path. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index f93b98f42f..99d88b31ee 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -215,6 +215,7 @@ static int dane_ctx_enable(struct dane_ctx_st *dctx)
mdord = OPENSSL_zalloc(n * sizeof(*mdord));
if (mdord == NULL || mdevp == NULL) {
+ OPENSSL_free(mdord);
OPENSSL_free(mdevp);
SSLerr(SSL_F_DANE_CTX_ENABLE, ERR_R_MALLOC_FAILURE);
return 0;