[gnome-remote-desktop] settings: Clear settings of type string before setting new values



commit ee63cac95e027c927ba81fb8066932e2827c4857
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Mon Nov 22 17:29:28 2021 +0100

    settings: Clear settings of type string before setting new values

 src/grd-settings.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/grd-settings.c b/src/grd-settings.c
index d2f31d2..54007a1 100644
--- a/src/grd-settings.c
+++ b/src/grd-settings.c
@@ -245,6 +245,7 @@ grd_settings_get_vnc_auth_method (GrdSettings *settings)
 static void
 update_rdp_tls_cert (GrdSettings *settings)
 {
+  g_clear_pointer (&settings->rdp.server_cert, g_free);
   settings->rdp.server_cert = g_settings_get_string (settings->rdp.settings,
                                                      "tls-cert");
 }
@@ -252,6 +253,7 @@ update_rdp_tls_cert (GrdSettings *settings)
 static void
 update_rdp_tls_key (GrdSettings *settings)
 {
+  g_clear_pointer (&settings->rdp.server_key, g_free);
   settings->rdp.server_key = g_settings_get_string (settings->rdp.settings,
                                                     "tls-key");
 }
@@ -321,6 +323,9 @@ grd_settings_finalize (GObject *object)
 {
   GrdSettings *settings = GRD_SETTINGS (object);
 
+  g_clear_pointer (&settings->rdp.server_cert, g_free);
+  g_clear_pointer (&settings->rdp.server_key, g_free);
+
   g_clear_object (&settings->rdp.settings);
   g_clear_object (&settings->vnc.settings);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]