[glib-networking/mcatanzaro/leaks] openssl: fix various leaks




commit cf36a86c46842f11cbec645bfa51ce91702b8646
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed Jun 23 16:10:21 2021 -0500

    openssl: fix various leaks

 tls/openssl/gtlscertificate-openssl.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
index 6777add..440e93a 100644
--- a/tls/openssl/gtlscertificate-openssl.c
+++ b/tls/openssl/gtlscertificate-openssl.c
@@ -131,6 +131,8 @@ get_subject_alt_names (GTlsCertificateOpenssl *cert,
               g_ptr_array_add (data, g_bytes_new (san, san_size));
             }
           }
+
+      sk_GENERAL_NAME_free (sans);
     }
 
   return data;
@@ -162,13 +164,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]