[gvfs] ftp: Only free connection if non-NULL
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] ftp: Only free connection if non-NULL
- Date: Mon, 11 Aug 2014 01:18:33 +0000 (UTC)
commit 63899f1a7e6aa286a97e82e99ae036d597cee748
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Thu Jul 31 18:54:46 2014 +0100
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 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index 10aeab4..068edd8 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]