dav/sync.c

changeset 669
152101df336d
parent 668
6df5ebb00841
child 672
4bfe452a2665
--- a/dav/sync.c	Wed Oct 23 20:10:55 2019 +0200
+++ b/dav/sync.c	Wed Oct 23 20:24:40 2019 +0200
@@ -4955,7 +4955,13 @@
         return -1;
     }
     
+    LocalResource *newres = NULL;
     LocalResource *localres = ucx_map_cstr_get(db->resources, file.path);
+    if(!localres) {
+        newres = calloc(1, sizeof(LocalResource));
+        newres->path = strdup(file.path);
+        localres = newres;
+    }
     UcxList *tags = NULL;
     DavBool store_tags = FALSE;
     
@@ -5019,6 +5025,10 @@
         }
     }
     
+    if(newres) {
+        local_resource_free(newres);
+    }
+    
     // store db
     if(store_db(db, file.dir->database, file.dir->db_settings)) {
         fprintf(stderr, "Cannot store sync db\n");

mercurial