mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:35: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:
|
||||
free(pfd);
|
||||
remove(pidfile);
|
||||
if (cards) {
|
||||
for (i = 0; i < count; i++)
|
||||
card_free(&cards[i]);
|
||||
free(cards);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue