From 12f5e4b46e9528e473a731e6e53ddef4b5e1e91d Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 21 Jul 2014 13:19:36 +0200 Subject: [PATCH] csync oC Util: set field flag correctly to avoid etag memleak. The fields varialbe should contain or'ed flags of the fields set in the csync_vio_file_stat_t struct. The problem was that the field for CSYNC_VIO_FILE_STAT_FIELDS_PERM was assigned rather than or'ed which makes the release function for the struct not freeing the etag memory => memleak. --- csync/src/csync_owncloud_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csync/src/csync_owncloud_util.c b/csync/src/csync_owncloud_util.c index 1a07a28543..af64ff6fc2 100644 --- a/csync/src/csync_owncloud_util.c +++ b/csync/src/csync_owncloud_util.c @@ -318,7 +318,7 @@ void resourceToFileStat(csync_vio_file_stat_t *lfs, struct resource *res ) lfs->directDownloadCookies = c_strdup(res->directDownloadCookies); } if (strlen(res->remotePerm) > 0) { - lfs->fields = CSYNC_VIO_FILE_STAT_FIELDS_PERM; + lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM; strncpy(lfs->remotePerm, res->remotePerm, sizeof(lfs->remotePerm)); } }