Sun, 27 Oct 2024 14:36:42 +0100
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); }