From: Kevin Ottens Date: Tue, 12 May 2020 12:32:34 +0000 (+0200) Subject: Fix leak in FileUtil::IsChildFile X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~241^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bfdb1e730a5e6924a3a38e8bad40c01a10570ebb;p=nextcloud-desktop.git Fix leak in FileUtil::IsChildFile Signed-off-by: Kevin Ottens --- diff --git a/shell_integration/windows/OCUtil/FileUtil.cpp b/shell_integration/windows/OCUtil/FileUtil.cpp index a0d381c92..9bb27af92 100644 --- a/shell_integration/windows/OCUtil/FileUtil.cpp +++ b/shell_integration/windows/OCUtil/FileUtil.cpp @@ -39,9 +39,9 @@ bool FileUtil::IsChildFile(const wchar_t* rootFolder, vector* 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; -} \ No newline at end of file +}