[mutter] core: Initialize g_autofree with NULL



commit 2a5506170a80b1ad75ee84da0007c672d654c23b
Author: Dor Askayo <dor askayo gmail com>
Date:   Sat Feb 19 16:05:38 2022 +0200

    core: Initialize g_autofree with NULL
    
    This prevents build warnings about use of potentially uninitialized
    variables.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2301>

 src/core/meta-pad-action-mapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/core/meta-pad-action-mapper.c b/src/core/meta-pad-action-mapper.c
index ac34ea98f7..d80878304e 100644
--- a/src/core/meta-pad-action-mapper.c
+++ b/src/core/meta-pad-action-mapper.c
@@ -642,7 +642,7 @@ meta_pad_action_mapper_handle_action (MetaPadActionMapper *mapper,
 {
   MetaPadDirection direction = META_PAD_DIRECTION_NONE;
   g_autoptr (GSettings) settings1 = NULL, settings2 = NULL;
-  g_autofree char *accel1, *accel2;
+  g_autofree char *accel1 = NULL, *accel2 = NULL;
   gboolean handled;
 
   if (action == META_PAD_ACTION_RING)
@@ -748,7 +748,7 @@ compose_directional_action_label (MetaPadDirection  direction1,
                                   MetaPadDirection  direction2,
                                   GSettings        *value2)
 {
-  g_autofree char *accel1, *accel2;
+  g_autofree char *accel1 = NULL, *accel2 = NULL;
   GString *str;
 
   accel1 = g_settings_get_string (value1, "keybinding");


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