diff --git a/src/utils/llist.c b/src/utils/llist.c
index 0d61769b26b8daea103c73e6bb3d8d31e1886be3..0af9c8cb11bec4346b96c557275b4a813ccfd618 100644 (file)
--- a/src/utils/llist.c
+++ b/src/utils/llist.c
{
sdb_llist_elem_t *elem;
- if ((! list) || (! lookup))
- return NULL;
+ assert(list && lookup);
for (elem = list->head; elem; elem = elem->next)
if (! lookup(elem->obj, user_data))
{
sdb_llist_elem_t *elem;
+ if ((! list) || (! lookup))
+ return NULL;
+
pthread_rwlock_rdlock(&list->lock);
elem = llist_search(list, lookup, user_data);
pthread_rwlock_unlock(&list->lock);
sdb_llist_elem_t *elem;
sdb_object_t *obj = NULL;
+ if ((! list) || (! lookup))
+ return NULL;
+
pthread_rwlock_wrlock(&list->lock);
elem = llist_search(list, lookup, user_data);
if (elem)