diff -r 48f43130b4a2 -r eee1f3092844 libidav/pwdstore.c --- a/libidav/pwdstore.c Mon Oct 28 15:20:58 2024 +0100 +++ b/libidav/pwdstore.c Mon Oct 28 16:47:59 2024 +0100 @@ -140,11 +140,7 @@ CxIterator i = cxMapIterator(p->ids); cx_foreach(CxMapEntry *, e, i) { PwdEntry *entry = e->value; - PwdEntry *new_entry = malloc(sizeof(PwdEntry)); - new_entry->id = strdup(entry->id); - new_entry->user = entry->user ? strdup(entry->user) : NULL; - new_entry->password = entry->password ? strdup(entry->password) : NULL; - cxMapPut(newp->ids, *e->key, new_entry); + pwdstore_put(newp, entry->id, entry->user, entry->password); } i = cxMapIterator(p->index); @@ -158,7 +154,7 @@ cxListAdd(locations, strdup(location)); } } - pwdstore_put_index(newp, entry->id, locations); + pwdstore_put_index(newp, strdup(entry->id), locations); } return newp;