[gnome-shell/gnome-40] src/shell: Plug some small leaks



commit 670ad1c634234a1b83356d86ee0d1f0c314cb282
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Aug 13 03:30:48 2021 +0200

    src/shell: Plug some small leaks
    
    Spotted by coverity in CID 351284 and 351288.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>
    (cherry picked from commit 506001ebc24543aefa62c4ddaf36802bafae13dc)

 src/shell-global.c   | 2 +-
 src/shell-perf-log.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index f05ec9b41b..24e771f52e 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1236,7 +1236,7 @@ shell_global_reexec_self (ShellGlobal *global)
   char *buf;
   char *buf_p;
   char *buf_end;
-  GError *error = NULL;
+  g_autoptr (GError) error = NULL;
 
   if (!g_file_get_contents ("/proc/self/cmdline", &buf, &len, &error))
     {
diff --git a/src/shell-perf-log.c b/src/shell-perf-log.c
index 95b116905f..3bd5228a01 100644
--- a/src/shell-perf-log.c
+++ b/src/shell-perf-log.c
@@ -862,7 +862,7 @@ replay_to_json (gint64      time,
                 gpointer    user_data)
 {
   ReplayToJsonClosure *closure = user_data;
-  char *event_str;
+  g_autofree char *event_str = NULL;
 
   if (closure->error != NULL)
     return;


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