mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 03:45:42 +01:00
alsactl: Fix potential NULL dereferences in daemon mode
The code releasing the each card object may access to NULL when a bogus count is given. Add a NULL check just to make sure. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9ea2a1d067
commit
9839813e7c
1 changed files with 5 additions and 3 deletions
|
@ -451,8 +451,10 @@ save:
|
||||||
out:
|
out:
|
||||||
free(pfd);
|
free(pfd);
|
||||||
remove(pidfile);
|
remove(pidfile);
|
||||||
|
if (cards) {
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
card_free(&cards[i]);
|
card_free(&cards[i]);
|
||||||
free(cards);
|
free(cards);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue