[Spice-devel] [PATCH spice-server] reds: Do not leak SSL context

Frediano Ziglio fziglio at redhat.com
Mon Mar 6 16:12:32 UTC 2017


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
I can write a test (or better extend the leak one) but
requires to add ca/certificate/private key.
---
 server/reds.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/reds.c b/server/reds.c
index 2983aae..fc720a3 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3703,6 +3703,10 @@ SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
     }
     reds_core_timer_remove(reds, reds->mig_timer);
 
+    if (reds->ctx) {
+        SSL_CTX_free(reds->ctx);
+    }
+
     if (reds->main_dispatcher) {
         g_object_unref(reds->main_dispatcher);
     }
-- 
2.9.3



More information about the Spice-devel mailing list