summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-12-07 12:23:54 +0100
committerBenjamin Otte <otte@redhat.com>2010-12-08 12:37:24 +0100
commit00f441ca8a8786eb755c07b73076e3d5c9bd60c6 (patch)
tree906cf68e3da62cf848ef41a9c60165d5d192f7a3 /daemon
parent2b6c559ea87fc929ac43527da5cc61c6d831f357 (diff)
downloadgvfs-00f441ca8a8786eb755c07b73076e3d5c9bd60c6.tar.gz
ftp: Fix refcounting of addresses when connecting
In error cases, we would get the refcounting wrong, which would lead to a warning when finalizing the backend, because we carried around an invalid pointer to an unreffed address for the whole time.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackendftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index ffd543d7..b4e1b2d0 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -380,6 +380,7 @@ do_mount (GVfsBackend *backend,
}
addr = G_NETWORK_ADDRESS (ftp->addr);
+ g_object_ref (addr);
port = g_network_address_get_port (addr);
username = NULL;
password = NULL;
@@ -514,6 +515,7 @@ try_login:
*/
if (!g_vfs_ftp_task_is_in_error (&task))
{
+ g_object_unref (ftp->addr);
ftp->addr = G_SOCKET_CONNECTABLE (g_vfs_ftp_connection_get_address (task.conn, &task.error));
if (ftp->addr == NULL)
{