[glib-networking/mcatanzaro/leaks] openssl: fix leak in privkey export
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/leaks] openssl: fix leak in privkey export
- Date: Wed, 23 Jun 2021 21:10:35 +0000 (UTC)
commit 4f19a896e72bba43cd8bcc302d6f9f766a111476
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Wed Jun 23 16:10:21 2021 -0500
openssl: fix leak in privkey export
tls/openssl/gtlscertificate-openssl.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
index 6777add..63fb248 100644
--- a/tls/openssl/gtlscertificate-openssl.c
+++ b/tls/openssl/gtlscertificate-openssl.c
@@ -162,13 +162,16 @@ export_privkey_to_der (GTlsCertificateOpenssl *openssl,
*output_data = g_malloc (*output_size);
memcpy (*output_data, data, *output_size);
- return;
+ goto out;
err:
- if (bio)
- BIO_free_all (bio);
*output_data = NULL;
*output_size = 0;
+out:
+ if (bio)
+ BIO_free_all (bio);
+ if (pkcs8)
+ PKCS8_PRIV_KEY_INFO_free (pkcs8);
}
static char *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]