Comment 1 for bug 1887910

Revision history for this message
Alex Tu (alextu) wrote :

after this patch, the issue can not be reproduced:
commit 24249e091ab3a935f6ea87b7f7355c689c045a80 (HEAD -> refs/heads/master)
Author: Luiz Augusto von Dentz <email address hidden>
Date: Mon Apr 9 14:48:41 2018 +0300

    shared/queue: Handle NULL as direct match on queue_remove_if

    As with queue_find when function is set to NULL use direct_match as
    callback.

diff --git a/src/shared/queue.c b/src/shared/queue.c
index 5ddb8326d..60df11143 100644
--- a/src/shared/queue.c
+++ b/src/shared/queue.c
@@ -280,9 +280,12 @@ void *queue_remove_if(struct queue *queue, queue_match_func_t function,
 {
        struct queue_entry *entry, *prev = NULL;

- if (!queue || !function)
+ if (!queue)
                return NULL;

+ if (!function)
+ function = direct_match;
+
        entry = queue->head;