From 74880110c3681dbc1310fc6bfac6375178ba222f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 13 Dec 2007 15:49:50 +0100 Subject: [PATCH] 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. --- src/pcm/pcm_softvol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.1