mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-08 10:06:19 -05:00
coverity.com fixes - initial round
This commit tries to fix a bunch of issues found by coverity.com. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
f0679e5de2
commit
47f4f9b73b
40 changed files with 283 additions and 133 deletions
18
src/async.c
18
src/async.c
|
|
@ -150,7 +150,6 @@ int snd_async_add_handler(snd_async_handler_t **handler, int fd,
|
|||
int snd_async_del_handler(snd_async_handler_t *handler)
|
||||
{
|
||||
int err = 0, err2 = 0;
|
||||
int was_empty;
|
||||
assert(handler);
|
||||
if (handler->type != SND_ASYNC_HANDLER_GENERIC) {
|
||||
struct list_head *alist;
|
||||
|
|
@ -184,15 +183,16 @@ int snd_async_del_handler(snd_async_handler_t *handler)
|
|||
}
|
||||
}
|
||||
_glist:
|
||||
was_empty = list_empty(&snd_async_handlers);
|
||||
list_del(&handler->glist);
|
||||
if (!was_empty && list_empty(&snd_async_handlers)) {
|
||||
err = sigaction(snd_async_signo, &previous_action, NULL);
|
||||
if (err < 0) {
|
||||
snd_errornum(CORE, "sigaction");
|
||||
return -errno;
|
||||
if (!list_empty(&snd_async_handlers)) {
|
||||
list_del(&handler->glist);
|
||||
if (list_empty(&snd_async_handlers)) {
|
||||
err = sigaction(snd_async_signo, &previous_action, NULL);
|
||||
if (err < 0) {
|
||||
snd_errornum(CORE, "sigaction");
|
||||
return -errno;
|
||||
}
|
||||
memset(&previous_action, 0, sizeof(previous_action));
|
||||
}
|
||||
memset(&previous_action, 0, sizeof(previous_action));
|
||||
}
|
||||
free(handler);
|
||||
return err ? err : err2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue