[gnome-settings-daemon/benzea/add-autoptr-init] plugins: Initialise all g_autoptr declarations



commit 51361f1e6a85c55e0b0fe2b88631af4d993bddee
Author: Benjamin Berg <bberg redhat com>
Date:   Tue Jan 21 17:59:15 2020 +0100

    plugins: Initialise all g_autoptr declarations
    
    While these specific cases should be acceptable, it is saner to always
    initialise autoptr declarations.

 plugins/power/gsd-power-manager.c                   | 2 +-
 plugins/usb-protection/gsd-usb-protection-manager.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c500fa38..c7a16e8d 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -927,7 +927,7 @@ dbus_call_log_error (GObject *source_object,
                      GAsyncResult *res,
                      gpointer user_data)
 {
-        g_autoptr(GVariant) result;
+        g_autoptr(GVariant) result = NULL;
         g_autoptr(GError) error = NULL;
         const gchar *msg = user_data;
 
diff --git a/plugins/usb-protection/gsd-usb-protection-manager.c 
b/plugins/usb-protection/gsd-usb-protection-manager.c
index 2c18aae8..daaf7771 100644
--- a/plugins/usb-protection/gsd-usb-protection-manager.c
+++ b/plugins/usb-protection/gsd-usb-protection-manager.c
@@ -147,7 +147,7 @@ dbus_call_log_error (GObject      *source_object,
                      GAsyncResult *res,
                      gpointer      user_data)
 {
-        g_autoptr(GVariant) result;
+        g_autoptr(GVariant) result = NULL;
         g_autoptr(GError) error = NULL;
         const gchar *msg = user_data;
 


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