[gvfs] ftp: Don't unlock unlocked mutex



commit 2153d300f24d3388d7c4ab75a55451ad5a581b5a
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Mon Aug 25 14:18:21 2014 +0100

    ftp: Don't unlock unlocked mutex
    
    Don't unlock an unlocked mutex since this causes an abort() with the
    latest glib (and is undefined anyway).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735381

 daemon/gvfsftptask.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index 068edd8..d78e0d5 100644
--- a/daemon/gvfsftptask.c
+++ b/daemon/gvfsftptask.c
@@ -232,7 +232,7 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task)
               g_vfs_ftp_task_login (task, ftp->user, ftp->password);
               g_vfs_ftp_task_setup_connection (task);
               if (G_LIKELY (!g_vfs_ftp_task_is_in_error (task)))
-                break;
+                goto out_unlocked;
 
               g_vfs_ftp_connection_free (task->conn);
               task->conn = NULL;
@@ -269,8 +269,9 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task)
           break;
         }
     }
-  g_cancellable_disconnect (task->cancellable, id);
   g_mutex_unlock (&ftp->mutex);
+out_unlocked:
+  g_cancellable_disconnect (task->cancellable, id);
 
   return task->conn != NULL;
 }


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