diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2014-07-31 18:54:46 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2014-08-11 03:15:54 +0200 |
commit | 63899f1a7e6aa286a97e82e99ae036d597cee748 (patch) | |
tree | bf4029c21c2ffef3915553e6188f30d01a061c54 /daemon/gvfsftptask.c | |
parent | 9bd1bd2c7a96b69ef4de956eb04d3bb58f748c0e (diff) | |
download | gvfs-63899f1a7e6aa286a97e82e99ae036d597cee748.tar.gz |
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
Diffstat (limited to 'daemon/gvfsftptask.c')
-rw-r--r-- | daemon/gvfsftptask.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 |