[gnome-control-center] Issue 1846, Check for NULL pointer before gtk_editable_set_text



commit b9bf21a016d4225e85d849102d2f6d1d7b96687c
Author: Jens Alpers <jensalpers hotmail com>
Date:   Mon Jul 11 02:20:50 2022 +0000

    Issue 1846, Check for NULL pointer before gtk_editable_set_text

 panels/sharing/cc-sharing-panel.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index ac189c699..1ac744cf0 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -1444,10 +1444,13 @@ cc_sharing_panel_setup_remote_desktop_dialog (CcSharingPanel *self)
         }
     }
 
-  if (password == NULL)
-    gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_password_entry),
-                           pw_generate ());
-
+  if (password == NULL) 
+    {
+      char * pw = pw_generate ();
+      if (pw)
+        gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_password_entry),
+                               pw );
+    }
   g_signal_connect (self->remote_desktop_device_name_copy,
                     "clicked", G_CALLBACK (on_device_name_copy_clicked),
                     self);


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