fixed memory leaks in lock and unlock commands

Mon, 21 Mar 2016 16:37:10 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 21 Mar 2016 16:37:10 +0100
changeset 230
fdcbde1d7d65
parent 229
df158262f802
child 231
f3119e749549

fixed memory leaks in lock and unlock commands

dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Mon Mar 21 16:15:23 2016 +0100
+++ b/dav/main.c	Mon Mar 21 16:37:10 2016 +0100
@@ -1172,6 +1172,7 @@
     char *url = a->argv[0];
     char *path = NULL;
     DavSession *sn = connect_to_repo(url2repo(url, &path), a);
+    ucx_mempool_reg_destr(sn->mp, path, free);
     
     if(set_session_config(sn, a)) {
         return -1;
@@ -1225,7 +1226,7 @@
     char *url = a->argv[0];
     char *path = NULL;
     DavSession *sn = connect_to_repo(url2repo(url, &path), a);
-    
+    ucx_mempool_reg_destr(sn->mp, path, free);
     if(set_session_config(sn, a)) {
         return -1;
     }
@@ -1242,6 +1243,7 @@
         }
         DavLock *lock = dav_create_lock(sn, locktoken, NULL);
         dav_add_collection_lock(sn, "/", lock);
+        free(locktoken);
     }
     
     DavResource *res = dav_resource_new(sn, path);

mercurial