[Spice-devel] [PATCH v2 x11spice 2/4] Free the SSL and password_file option fields.

Jeremy White jwhite at codeweavers.com
Thu Jul 18 21:14:03 UTC 2019


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 src/options.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/options.c b/src/options.c
index a206c92c..303c07de 100644
--- a/src/options.c
+++ b/src/options.c
@@ -50,6 +50,17 @@ void options_init(options_t *options)
     memset(options, 0, sizeof(*options));
 }
 
+void ssl_options_free(ssl_options_t *ssl)
+{
+    g_free(ssl->ca_cert_file);
+    g_free(ssl->certs_file);
+    g_free(ssl->private_key_file);
+    g_free(ssl->key_password);
+    g_free(ssl->dh_key_file);
+    g_free(ssl->ciphersuite);
+    *ssl = (ssl_options_t) { 0 };
+}
+
 void options_free(options_t *options)
 {
     g_free(options->display);
@@ -57,8 +68,12 @@ void options_free(options_t *options)
     g_free(options->listen);
     options->listen = NULL;
 
+    ssl_options_free(&options->ssl);
+
     g_free(options->spice_password);
     options->spice_password = NULL;
+    g_free(options->password_file);
+    options->password_file = NULL;
 
     g_free(options->virtio_path);
     options->virtio_path = NULL;
-- 
2.11.0



More information about the Spice-devel mailing list