mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* extfs.c (extfs_internal_stat): Fixed memory leaks introduced
by my change from 2004-08-16. (extfs_unlink): likewise. * ftpfs.c (ftpfs_send_command): likewise.
This commit is contained in:
parent
6bd2914cc1
commit
83c07852e9
@ -1,3 +1,10 @@
|
||||
2004-08-24 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* extfs.c (extfs_internal_stat): Fixed memory leaks introduced
|
||||
by my change from 2004-08-16. (extfs_unlink): likewise.
|
||||
|
||||
* ftpfs.c (ftpfs_send_command): likewise.
|
||||
|
||||
2004-08-21 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* extfs/urar.in: Fix non-POSIX constructs.
|
||||
|
13
vfs/extfs.c
13
vfs/extfs.c
@ -937,17 +937,21 @@ static int extfs_internal_stat (const char *path, struct stat *buf, int resolve)
|
||||
struct entry *entry;
|
||||
struct inode *inode;
|
||||
char *path2 = g_strdup(path);
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (path2, &archive, 0, 0)) == NULL)
|
||||
return -1;
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
return -1;
|
||||
goto cleanup;
|
||||
if (resolve && (entry = extfs_resolve_symlinks (entry)) == NULL)
|
||||
return -1;
|
||||
goto cleanup;
|
||||
inode = entry->inode;
|
||||
extfs_stat_move( buf, inode );
|
||||
return 0;
|
||||
result = 0;
|
||||
cleanup:
|
||||
g_free (path2);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int extfs_stat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
@ -1032,6 +1036,7 @@ static int extfs_unlink (struct vfs_class *me, const char *file)
|
||||
}
|
||||
if (extfs_cmd (" rm ", archive, entry, "")){
|
||||
my_errno = EIO;
|
||||
goto cleanup;
|
||||
}
|
||||
extfs_remove_entry (entry);
|
||||
result = 0;
|
||||
|
@ -1460,8 +1460,11 @@ ftpfs_send_command(struct vfs_class *me, const char *filename, const char *cmd,
|
||||
vfs_stamp_create (&vfs_ftpfs_ops, super);
|
||||
if (flags & OPT_IGNORE_ERROR)
|
||||
r = COMPLETE;
|
||||
if (r != COMPLETE)
|
||||
ERRNOR (EPERM, -1);
|
||||
if (r != COMPLETE) {
|
||||
me->verrno = EPERM;
|
||||
g_free (mpath);
|
||||
return -1;
|
||||
}
|
||||
if (flush_directory_cache)
|
||||
vfs_s_invalidate(me, super);
|
||||
g_free(mpath);
|
||||
|
Loading…
Reference in New Issue
Block a user