1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-04-09 19:15:43 +02:00

Fix leak in FileUtil::IsChildFile

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-05-12 14:32:34 +02:00
parent d2b4d1de4b
commit bfdb1e730a

View File

@ -39,9 +39,9 @@ bool FileUtil::IsChildFile(const wchar_t* rootFolder, vector<wstring>* files)
bool FileUtil::IsChildFile(const wchar_t* rootFolder, const wchar_t* file)
{
wstring* f = new wstring(file);
const wstring f(file);
size_t found = f->find(rootFolder);
size_t found = f.find(rootFolder);
if(found != string::npos)
{
@ -83,4 +83,4 @@ bool FileUtil::IsChildFileOfRoot(const wchar_t* filePath)
delete rootFolder;
return needed;
}
}