[Pkg-owncloud-commits] [owncloud-client] 89/135: windows: Fix a memory leak in FileSystem::longWinPath

Sandro Knauß hefee at debian.org
Sat Sep 9 14:28:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

hefee pushed a commit to branch master
in repository owncloud-client.

commit e9bc49b9055bebe0a5db375e36c0819c54e1d79d
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Mon Jul 24 15:11:30 2017 +0200

    windows: Fix a memory leak in FileSystem::longWinPath
    
    Also use c_path_to_UNC directly instead of doing an extra
    UTF-8->wchar conversion.
    
    (cherry picked from commit 5a1bf7d8feb1900fd93ca4f9c613cef4c9cbff93)
---
 src/libsync/filesystem.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp
index 044ea39..fd15148 100644
--- a/src/libsync/filesystem.cpp
+++ b/src/libsync/filesystem.cpp
@@ -52,12 +52,14 @@ namespace OCC {
 
 QString FileSystem::longWinPath( const QString& inpath )
 {
-    QString path(inpath);
-
 #ifdef Q_OS_WIN
-    path = QString::fromWCharArray( static_cast<wchar_t*>( c_utf8_path_to_locale(inpath.toUtf8() ) ) );
-#endif
+    const char *unc_str = c_path_to_UNC(inpath.toUtf8());
+    QString path = QString::fromUtf8(unc_str);
+    free((void*)unc_str);
     return path;
+#else
+    return inpath;
+#endif
 }
 
 bool FileSystem::fileEquals(const QString& fn1, const QString& fn2)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list