mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
Ticket #4620: (sftpfs_fill_connection_data_from_config): fix use-after-free.
Fix Use-after-free in sftpfs_fill_connection_data_from_config()
Found by Clang-19 Static Analyzer
The bug was introduced in 4c998ac636
.
Reported-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
0df9c46cd1
commit
d0d8ae90eb
@ -393,9 +393,12 @@ sftpfs_fill_connection_data_from_config (struct vfs_s_super *super, GError **mce
|
||||
|
||||
if (config_entity->real_host != NULL)
|
||||
{
|
||||
g_free (super->path_element->host);
|
||||
char *tmp_str = super->path_element->host;
|
||||
|
||||
super->path_element->host =
|
||||
sftpsfs_expand_hostname (super->path_element->host, config_entity->real_host);
|
||||
|
||||
g_free (tmp_str);
|
||||
}
|
||||
|
||||
if (config_entity->identity_file != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user