--- mc/vfs/vfs.c.orig 2008-02-24 16:47:23 +0500 +++ mc/vfs/vfs.c 2008-03-16 22:18:11 +0500 @@ -357,6 +357,11 @@ int mc_##name inarg \ int result; \ char *mpath = vfs_canon (path); \ vfs = vfs_get_class (mpath); \ + if (!vfs) \ + { \ + g_free(mpath); \ + return -1; \ + } \ result = vfs->name ? (*vfs->name)callarg : -1; \ g_free (mpath); \ if (result == -1) \ @@ -383,6 +388,8 @@ int mc_##name inarg \ if (handle == -1) \ return -1; \ vfs = vfs_op (handle); \ + if (!vfs) \ + return -1; \ result = vfs->name ? (*vfs->name)callarg : -1; \ if (result == -1) \ errno = vfs->name ? ferrno (vfs) : E_NOTSUPP; \