diff --git a/lib/vfs/mc-vfs/direntry.c b/lib/vfs/mc-vfs/direntry.c index 1fe31d41a..314696be1 100644 --- a/lib/vfs/mc-vfs/direntry.c +++ b/lib/vfs/mc-vfs/direntry.c @@ -1166,8 +1166,12 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode) } split_dir_name (me, q, &dirname, &name, &save); - /* FIXME: check if vfs_s_find_inode returns NULL */ dir = vfs_s_find_inode (me, super, dirname, LINK_FOLLOW, FL_DIR); + if (dir == NULL) + { + g_free (q); + return NULL; + } if (save) *save = PATH_SEP; ent = vfs_s_generate_entry (me, name, dir, 0755); diff --git a/lib/vfs/mc-vfs/gc.c b/lib/vfs/mc-vfs/gc.c index 81ce710a7..d789c3a54 100644 --- a/lib/vfs/mc-vfs/gc.c +++ b/lib/vfs/mc-vfs/gc.c @@ -222,7 +222,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid) n3vfsid = NULL; } - if (!oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid)) + if (!oldvfs || !oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid)) return; vfs_addstamp (oldvfs, oldvfsid);