From bfdb1e730a5e6924a3a38e8bad40c01a10570ebb Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 12 May 2020 14:32:34 +0200 Subject: [PATCH] Fix leak in FileUtil::IsChildFile Signed-off-by: Kevin Ottens --- shell_integration/windows/OCUtil/FileUtil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +} -- 2.30.2