do not delete invalid pointer

This commit is contained in:
unK
2008-10-28 12:43:02 +01:00
parent e18e6ef3a8
commit 6b2356318f

View File

@@ -64,11 +64,10 @@ namespace
{
dirent **list;
int n = scandir(dir.c_str(), &list, NULL, alphasort);
if (n < 2)
{
delete list;
if (n < 0)
return;
}
struct stat file_stat;
string full_path;
for (int i = 2; i < n; i++)