libidav/pwdstore.c

changeset 60
ee4e4742391e
parent 55
1ce14068ef31
--- a/libidav/pwdstore.c	Wed Oct 23 21:46:43 2024 +0200
+++ b/libidav/pwdstore.c	Sun Oct 27 18:24:37 2024 +0100
@@ -377,12 +377,13 @@
     }
     PwdIndexEntry *newentry = malloc(sizeof(PwdIndexEntry));
     newentry->id = id;
-    if(locations) {
+    if(cxListSize(locations) > 0) {
         newentry->locations = locations;
         cxListAdd(p->locations, newentry);
     } else {
         newentry->locations = NULL;
         cxListAdd(p->noloc, newentry);
+        cxListDestroy(locations);
     }
     cxMapPut(p->index, cx_hash_key_str(id), newentry);
 }

mercurial