(mc_closedir): fix NULL dereference.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2016-03-24 11:07:09 +03:00
parent a9e5957196
commit 623015eb0d

View File

@ -515,10 +515,15 @@ mc_readdir (DIR * dirp)
int
mc_closedir (DIR * dirp)
{
int handle = *(int *) dirp;
int handle;
struct vfs_class *vfs;
int result = -1;
if (dirp == NULL)
return result;
handle = *(int *) dirp;
vfs = vfs_class_find_by_handle (handle);
if (vfs != NULL)
{