Commit 7c28c94a authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

Win32: fix uninitialised variable and double free in drive letters mode

Close #14140
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 3ca2ce1e87a85a924c0f7ef45324d31c65a986cd)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9d9b2bf7
......@@ -149,6 +149,7 @@ DIR *vlc_opendir (const char *dirname)
free (wpath);
p_dir->wdir = NULL;
p_dir->u.drives = GetLogicalDrives ();
p_dir->entry = NULL;
return (void *)p_dir;
}
#endif
......@@ -180,7 +181,10 @@ char *vlc_readdir (DIR *dir)
{
DWORD drives = p_dir->u.drives;
if (drives == 0)
{
p_dir->entry = NULL;
return NULL; /* end */
}
unsigned int i;
for (i = 0; !(drives & 1); i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment