libidav/resource.c

changeset 852
83fdf679df99
parent 850
bbe2925eb590
--- a/libidav/resource.c	Thu Nov 28 17:53:13 2024 +0100
+++ b/libidav/resource.c	Mon Jan 06 21:18:36 2025 +0100
@@ -131,7 +131,7 @@
         // TODO: free everything
         dav_session_free(sn, property);
     }
-    cxMapDestroy(properties);
+    cxMapFree(properties);
 }
 
 void dav_resource_free(DavResource *res) {
@@ -807,7 +807,7 @@
     CxBuffer *rqbuf = create_propfind_request(res->session, proplist, "propfind", 0);
     int ret = dav_propfind(res->session, res, rqbuf);
     cxBufferFree(rqbuf);
-    cxMempoolDestroy(mp);
+    cxMempoolFree(mp);
     return ret;
 }
 
@@ -1016,7 +1016,8 @@
                 cx_foreach(DavProperty *, property, i) {
                     cxmutstr keystr = dav_property_key(property->ns->name, property->name);
                     CxHashKey key = cx_hash_key(keystr.ptr, keystr.length);
-                    DavProperty *existing_prop = cxMapRemoveAndGet(crypto_props, key);
+                    DavProperty *existing_prop = NULL;
+                    cxMapRemoveAndGet(crypto_props, key, &existing_prop);
                     cxMapPut(crypto_props, key, property);
                     if(existing_prop) {
                         // TODO: free existing_prop
@@ -1534,7 +1535,7 @@
     
     cxBufferPutString(content, "</D:prop>");
     
-    cxMapDestroy(nsmap);
+    cxMapFree(nsmap);
     
     // encrypt xml document
     char *crypto_prop_content = aes_encrypt(content->space, content->size, sn->key);
@@ -1607,7 +1608,7 @@
     
     xmlFreeDoc(doc);
     if(cxMapSize(map) == 0) {
-        cxMapDestroy(map);
+        cxMapFree(map);
         return NULL;
     }
     return map;

mercurial