mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复访问野指针的问题:#146
This commit is contained in:
parent
e6d511cc9e
commit
083933cbad
@ -433,8 +433,9 @@ static string findIndexFile(const string &dir){
|
||||
while ((pDirent = readdir(pDir)) != NULL) {
|
||||
static set<const char *,StrCaseCompare> indexSet = {"index.html","index.htm","index"};
|
||||
if(indexSet.find(pDirent->d_name) != indexSet.end()){
|
||||
string ret = pDirent->d_name;
|
||||
closedir(pDir);
|
||||
return pDirent->d_name;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
closedir(pDir);
|
||||
|
Loading…
Reference in New Issue
Block a user