mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
(smbfs_fake_share_stat): don't access to free'd memory.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
2640b21bb9
commit
a35ee6aebc
@ -1475,20 +1475,22 @@ smbfs_fake_share_stat (const char *server_url, const char *path, struct stat *bu
|
|||||||
/* Make sure there is such share at server */
|
/* Make sure there is such share at server */
|
||||||
smbfs_connection *sc;
|
smbfs_connection *sc;
|
||||||
char *p;
|
char *p;
|
||||||
vfs_path_t *vpath = vfs_path_from_str (path);
|
vfs_path_t *vpath;
|
||||||
|
|
||||||
|
vpath = vfs_path_from_str (path);
|
||||||
p = smbfs_get_path (&sc, vpath);
|
p = smbfs_get_path (&sc, vpath);
|
||||||
vfs_path_free (vpath);
|
vfs_path_free (vpath);
|
||||||
|
|
||||||
g_free (p);
|
if (p != NULL)
|
||||||
if (p)
|
|
||||||
{
|
{
|
||||||
memset (buf, 0, sizeof (*buf));
|
memset (buf, 0, sizeof (*buf));
|
||||||
/* show this as dir */
|
/* show this as dir */
|
||||||
buf->st_mode =
|
buf->st_mode =
|
||||||
(S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH) & myumask;
|
(S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH) & myumask;
|
||||||
|
g_free (p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
g_free (p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user