[Pkg-owncloud-commits] [owncloud-client] 22/70: Fix resource leak in win32 code path, added free of locale filename.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Jul 1 10:21:19 UTC 2014


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

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

commit 9ee86cf06b709c370ded89f19b932cc876eb7452
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Fri Jun 20 10:25:00 2014 +0200

    Fix resource leak in win32 code path, added free of locale filename.
    
    This fixes Coverity CID 12901
---
 csync/src/csync_util.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/csync/src/csync_util.c b/csync/src/csync_util.c
index ffcdafb..74d24a0 100644
--- a/csync/src/csync_util.c
+++ b/csync/src/csync_util.c
@@ -113,12 +113,12 @@ void csync_win32_set_file_hidden( const char *file, bool h ) {
   fileName = c_utf8_to_locale( file );
   dwAttrs = GetFileAttributesW(fileName);
 
-  if (dwAttrs==INVALID_FILE_ATTRIBUTES) return;
-
-  if (h && !(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
-     SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
-  } else if (!h && (dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
-     SetFileAttributesW(fileName, dwAttrs & ~FILE_ATTRIBUTE_HIDDEN );
+  if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
+      if (h && !(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
+          SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
+      } else if (!h && (dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
+          SetFileAttributesW(fileName, dwAttrs & ~FILE_ATTRIBUTE_HIDDEN );
+      }
   }
 
   c_free_locale_string(fileName);

-- 
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