diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index 52e41de4c..b64588138 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -379,13 +379,21 @@ fish_free_archive (struct vfs_class *me, struct vfs_s_super *super) fish_super_t *fish_super = FISH_SUPER (super); if ((fish_super->sockw != -1) || (fish_super->sockr != -1)) - { vfs_print_message (_("fish: Disconnecting from %s"), super->name ? super->name : "???"); + + if (fish_super->sockw != -1) + { fish_command (me, super, NONE, "#BYE\nexit\n", -1); close (fish_super->sockw); - close (fish_super->sockr); - fish_super->sockw = fish_super->sockr = -1; + fish_super->sockw = -1; } + + if (fish_super->sockr != -1) + { + close (fish_super->sockr); + fish_super->sockr = -1; + } + g_free (fish_super->scr_ls); g_free (fish_super->scr_exists); g_free (fish_super->scr_mkdir);