mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-02 00:16:04 +03:00
SFTP: minor refactoring.
sftpfs_super_data created at sftpfs_cb_open_connection() was freed at sftpfs_close_connection(). It should be sftpfs_cb_close_connection() for logical right location. Signed-off-by: Andreas Mohr <and@gmx.li> Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
298273b8f5
commit
ece1d020fa
@ -440,9 +440,6 @@ sftpfs_close_connection (struct vfs_s_super *super, const char *shutdown_message
|
||||
if (super_data == NULL)
|
||||
return;
|
||||
|
||||
vfs_path_element_free (super_data->original_connection_info);
|
||||
super_data->original_connection_info = NULL;
|
||||
|
||||
if (super_data->agent != NULL)
|
||||
{
|
||||
libssh2_agent_disconnect (super_data->agent);
|
||||
|
@ -138,11 +138,18 @@ static void
|
||||
sftpfs_cb_close_connection (struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
GError *mcerror = NULL;
|
||||
sftpfs_super_data_t *sftpfs_super_data;
|
||||
|
||||
(void) me;
|
||||
sftpfs_close_connection (super, "Normal Shutdown", &mcerror);
|
||||
|
||||
sftpfs_super_data = (sftpfs_super_data_t *) super->data;
|
||||
if (sftpfs_super_data != NULL)
|
||||
vfs_path_element_free (sftpfs_super_data->original_connection_info);
|
||||
|
||||
mc_error_message (&mcerror, NULL);
|
||||
g_free (super->data);
|
||||
|
||||
g_free (sftpfs_super_data);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user