From ffc5e6f0cc616084f4afa2789db6c4b1c4eceabe Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 30 Aug 2012 13:04:48 +0300 Subject: [PATCH] Memory cleanups for id syncing, removed unused code. --- src/csync_util.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/csync_util.c b/src/csync_util.c index 66913928c2..fccfce5ec8 100644 --- a/src/csync_util.c +++ b/src/csync_util.c @@ -222,6 +222,7 @@ static int _merge_file_trees_visitor(void *obj, void *data) { tfs = c_rbtree_node_data(node); if( tfs->md5 ) { + if( fs->md5 ) SAFE_FREE(fs->md5); fs->md5 = c_strdup( tfs->md5 ); CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "PRE UPDATED %s: %s <-> %s", uri, fs->md5, tfs->md5); } else { @@ -342,18 +343,4 @@ uint64_t csync_create_statedb_hash(CSYNC *ctx) { return hash; } -static char* digest_to_out(unsigned char* digest) -{ - char *out = c_malloc(33); - int n; - - if( !digest ) return NULL; - - for (n = 0; n < 16; ++n) { - snprintf(&(out[n*2]), 16*2, "%02x", (unsigned int) *(digest+n)); - } - - return out; -} - /* vim: set ts=8 sw=2 et cindent: */