[gvfs] client: Fix up error handling in find_enclosing_mount



commit 7757c2bcfef808c860ec0e8676d69301a0f821d1
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Mon Nov 3 22:49:42 2014 +0000

    client: Fix up error handling in find_enclosing_mount
    
    2a0dc68c7eeb ("client: Remove inconsistencies between async and sync
    variants") introduced a regression which causes find_enclosing_mount to
    segfault if a non-NULL GError** is passed in.  Fix this.  Also, only
    call g_dbus_error_strip_remote_error () on GErrors that have come from
    dbus.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739075

 client/gdaemonfile.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 69104c5..3373341 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2279,8 +2279,11 @@ g_daemon_file_find_enclosing_mount (GFile *file,
                                                  cancellable,
                                                  error);
 
-  if (error)
-    goto out;
+  if (error && *error)
+    {
+      g_dbus_error_strip_remote_error (*error);
+      return NULL;
+    }
 
   if (mount_info == NULL)
     {
@@ -2288,7 +2291,7 @@ g_daemon_file_find_enclosing_mount (GFile *file,
                    G_IO_ERROR_FAILED,
                    "Internal error: \"%s\"",
                    "No error but no mount info from g_daemon_vfs_get_mount_info_sync");
-      goto out;
+      return NULL;
     }
 
   if (mount_info->user_visible)
@@ -2310,10 +2313,6 @@ g_daemon_file_find_enclosing_mount (GFile *file,
      corresponding to a particular path/uri */
                       _("Could not find enclosing mount"));
  
-out:
-  if (error && *error)
-    g_dbus_error_strip_remote_error (*error);
-
   return NULL;
 }
 


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