Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@nextcloud.com>2020-05-12 15:32:34 +0300
committerKevin Ottens <kevin.ottens@nextcloud.com>2020-05-12 15:32:34 +0300
commitbfdb1e730a5e6924a3a38e8bad40c01a10570ebb (patch)
tree747659ff2906bcf05e6faf3172ec1dffc41a68ae /shell_integration
parentd2b4d1de4b7786bb328af3259a430fd5e20c0326 (diff)
Fix leak in FileUtil::IsChildFile
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Diffstat (limited to 'shell_integration')
-rw-r--r--shell_integration/windows/OCUtil/FileUtil.cpp6
1 files 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<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;
-} \ No newline at end of file
+}