From: Takashi Iwai Date: Thu, 13 Dec 2007 14:49:50 +0000 (+0100) Subject: Fix segfault with strdup(NULL) in softvol X-Git-Tag: v1.0.16rc1~31 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=74880110c3681dbc1310fc6bfac6375178ba222f;p=alsa-lib.git 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. --- diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c index 97894bb4..45dae534 100644 --- a/src/pcm/pcm_softvol.c +++ b/src/pcm/pcm_softvol.c @@ -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; }