From: Jaroslav Kysela Date: Tue, 20 Nov 2001 15:16:58 +0000 (+0000) Subject: Added extra initialization for hlist X-Git-Tag: v1.0.3~589 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=7b569ec4130e6b30db79d3b82530260670d308a7;p=alsa-lib.git Added extra initialization for hlist --- 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) {