diff -r 1f40ca07ae1b -r 839fefbdedc7 libidav/session.c --- a/libidav/session.c Sat Apr 20 13:01:58 2024 +0200 +++ b/libidav/session.c Thu May 23 22:35:45 2024 +0200 @@ -31,8 +31,7 @@ #include #include -#include -#include +#include #include #include "utils.h" @@ -636,16 +635,6 @@ if(cxMapRemoveAndGet(locks->resource_locks, cx_hash_key_str(path))) { return; } - - CxMutIterator i = cxListMutIterator(locks->collection_locks); - int rm = 0; - cx_foreach(DavLock* , cl, i) { - if(rm) { - break; - } - if(cl == lock) { - cxIteratorFlagRemoval(i); - rm = 1; - } - } + + cxListFindRemove(locks->collection_locks, lock); }