fix crash when removing pwdentries without locations

Mon, 28 Oct 2024 10:36:59 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 28 Oct 2024 10:36:59 +0100
changeset 840
9904eee3ca9a
parent 839
23f3b02c6725
child 841
21403bdaf54c

fix crash when removing pwdentries without locations

libidav/pwdstore.c file | annotate | diff | comparison | revisions
--- a/libidav/pwdstore.c	Mon Oct 28 09:37:04 2024 +0100
+++ b/libidav/pwdstore.c	Mon Oct 28 10:36:59 2024 +0100
@@ -235,7 +235,9 @@
     PwdEntry *e = cxMapRemoveAndGet(s->ids, key);
     
     if(i) {
-        cxListDestroy(i->locations);
+        if(i->locations) {
+            cxListDestroy(i->locations);
+        }
         free(i->id);
         free(i);
     }

mercurial