From 7263e6d860fa881fa64e8c6b3ead4d34df4c16c9 Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 22 Jun 2017 17:55:48 +0000 Subject: [PATCH] Plug a memory leak in tls_keypair_cert_hash(), introduced in r1.60. --- lib/libtls/tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libtls/tls.c b/lib/libtls/tls.c index 77b936ed37c..e6135aedef4 100644 --- a/lib/libtls/tls.c +++ b/lib/libtls/tls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls.c,v 1.64 2017/06/22 17:47:56 jsing Exp $ */ +/* $OpenBSD: tls.c,v 1.65 2017/06/22 17:55:48 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -297,7 +297,9 @@ tls_keypair_cert_hash(struct tls_keypair *keypair, char **hash) goto err; rv = tls_cert_hash(cert, hash); + err: + X509_free(cert); BIO_free(membio); return (rv); -- 2.20.1