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:
parent
d2b4d1de4b
commit
bfdb1e730a
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user