libidav/pwdstore.c

changeset 835
b4285fb0f582
parent 833
8aa2dc02d9b7
--- a/libidav/pwdstore.c	Wed Oct 23 19:12:51 2024 +0200
+++ b/libidav/pwdstore.c	Sun Oct 27 14:36:42 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