From 63899f1a7e6aa286a97e82e99ae036d597cee748 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Thu, 31 Jul 2014 18:54:46 +0100 Subject: ftp: Only free connection if non-NULL Only attempt to free the connection if it is non-NULL, to prevent warnings like the following: ** (process:30854): CRITICAL **: g_vfs_ftp_connection_free: assertion 'conn != NULL' failed The connection can be NULL if g_vfs_ftp_connection_new is cancelled. https://bugzilla.gnome.org/show_bug.cgi?id=591054 --- daemon/gvfsftptask.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'daemon/gvfsftptask.c') diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c index 10aeab46..068edd83 100644 --- a/daemon/gvfsftptask.c +++ b/daemon/gvfsftptask.c @@ -233,10 +233,11 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task) g_vfs_ftp_task_setup_connection (task); if (G_LIKELY (!g_vfs_ftp_task_is_in_error (task))) break; + + g_vfs_ftp_connection_free (task->conn); + task->conn = NULL; } - g_vfs_ftp_connection_free (task->conn); - task->conn = NULL; g_mutex_lock (&ftp->mutex); ftp->connections--; /* If this value is still equal to our thread it means there were no races -- cgit v1.2.1