do not delete invalid pointer
This commit is contained in:
@@ -64,11 +64,10 @@ namespace
|
|||||||
{
|
{
|
||||||
dirent **list;
|
dirent **list;
|
||||||
int n = scandir(dir.c_str(), &list, NULL, alphasort);
|
int n = scandir(dir.c_str(), &list, NULL, alphasort);
|
||||||
if (n < 2)
|
|
||||||
{
|
if (n < 0)
|
||||||
delete list;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
struct stat file_stat;
|
struct stat file_stat;
|
||||||
string full_path;
|
string full_path;
|
||||||
for (int i = 2; i < n; i++)
|
for (int i = 2; i < n; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user