From 7b569ec4130e6b30db79d3b82530260670d308a7 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 20 Nov 2001 15:16:58 +0000 Subject: [PATCH] Added extra initialization for hlist --- src/async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/async.c b/src/async.c index a89bbfd3..8c63464f 100644 --- a/src/async.c +++ b/src/async.c @@ -89,6 +89,7 @@ int snd_async_add_handler(snd_async_handler_t **handler, int fd, h->private_data = private_data; was_empty = list_empty(&snd_async_handlers); list_add_tail(&h->glist, &snd_async_handlers); + INIT_LIST_HEAD(&h->hlist); *handler = h; if (was_empty) { int err; @@ -129,7 +130,8 @@ int snd_async_del_handler(snd_async_handler_t *handler) } if (handler->type == SND_ASYNC_HANDLER_GENERIC) goto _end; - list_del(&handler->hlist); + if (!list_empty(&handler->hlist)) + list_del(&handler->hlist); if (!list_empty(&handler->hlist)) goto _end; switch (handler->type) { -- 2.47.1