[gnome-flashback] inhibit-dialog: fix memory leak



commit 3aecc0e551267aa408435c7ecb94d7abfc273cb5
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Mar 16 16:57:23 2021 +0200

    inhibit-dialog: fix memory leak
    
    Coverity CID: #1502695

 .../libend-session-dialog/gf-inhibit-dialog.c       | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gnome-flashback/libend-session-dialog/gf-inhibit-dialog.c 
b/gnome-flashback/libend-session-dialog/gf-inhibit-dialog.c
index e243bea..b1e7841 100644
--- a/gnome-flashback/libend-session-dialog/gf-inhibit-dialog.c
+++ b/gnome-flashback/libend-session-dialog/gf-inhibit-dialog.c
@@ -514,12 +514,23 @@ update_dialog_text (GfInhibitDialog *dialog)
       title = _("Log Out");
 
       if (inhibited)
-        description = g_strdup (_("Click Log Out to quit these applications and log out of the system."));
+        {
+          description = g_strdup (_("Click Log Out to quit these applications and log out of the system."));
+        }
       else
-        description = g_strdup_printf (ngettext ("%s will be logged out automatically in %d second.",
-                                                 "%s will be logged out automatically in %d seconds.",
-                                                 seconds),
-                                       get_user_name (), seconds);
+        {
+          char *user_name;
+
+          user_name = get_user_name ();
+
+          description = g_strdup_printf (ngettext ("%s will be logged out automatically in %d second.",
+                                                   "%s will be logged out automatically in %d seconds.",
+                                                   seconds),
+                                         user_name,
+                                         seconds);
+
+          g_free (user_name);
+        }
     }
   else if (priv->action == GF_LOGOUT_ACTION_SHUTDOWN)
     {


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