[Pkg-owncloud-commits] [owncloud-client] 129/498: csync: fix a few possible leak in error cases

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:43 UTC 2015


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 5dcb2763761f935da95688a7a5acb48dd54605e4
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Jun 8 15:31:14 2015 +0200

    csync: fix a few possible leak in error cases
---
 csync/src/csync_exclude.c | 2 ++
 csync/src/csync_update.c  | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c
index 484ad80..b276f93 100644
--- a/csync/src/csync_exclude.c
+++ b/csync/src/csync_exclude.c
@@ -282,6 +282,8 @@ CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path
   if (getenv("CSYNC_CONFLICT_FILE_USERNAME")) {
       rc = asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
       if (rc < 0) {
+          SAFE_FREE(bname);
+          SAFE_FREE(dname);
           goto out;
       }
       rc = csync_fnmatch(conflict, path, 0);
diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index 1c89a87..fdd22ea 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -222,6 +222,7 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
       tmp = csync_statedb_get_stat_by_hash(ctx, h);
       if(_last_db_return_error(ctx)) {
           SAFE_FREE(st);
+          SAFE_FREE(tmp);
           ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
           return -1;
       }
@@ -404,6 +405,7 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
     }
   } else  {
       CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Unable to open statedb" );
+      SAFE_FREE(st);
       ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
       return -1;
   }
@@ -743,6 +745,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
 
         if(_last_db_return_error(ctx)) {
             ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
+            SAFE_FREE(etag);
             goto error;
         }
 

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