fix pwdstore entries without locations not loaded correctly

Sun, 27 Oct 2024 14:36:42 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 27 Oct 2024 14:36:42 +0100
changeset 835
b4285fb0f582
parent 834
6a466635eace
child 836
7842c7665cd0

fix pwdstore entries without locations not loaded correctly

libidav/pwdstore.c file | annotate | diff | comparison | revisions
--- 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