mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Fix segfault with strdup(NULL) in softvol
The last change to fix the slave name may cause a segfault when name=NULL is passed. Fixed now.
This commit is contained in:
parent
6e6f4b9c93
commit
74880110c3
1 changed files with 1 additions and 1 deletions
|
|
@ -782,7 +782,7 @@ int snd_pcm_softvol_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (err > 0) { /* hardware control - no need for softvol! */
|
||||
softvol_free(svol);
|
||||
*pcmp = slave; /* just pass the slave */
|
||||
if (!slave->name)
|
||||
if (!slave->name && name)
|
||||
slave->name = strdup(name);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue