summaryrefslogtreecommitdiffstats
path: root/plugins/audio/audio-pulse.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-05-30 15:49:39 +0200
committerManuel Bachmann <manuel.bachmann@iot.bzh>2016-05-30 15:49:39 +0200
commit5b5a2534e5effa69c800c2384c90dff4bc887c09 (patch)
treebcd765eea7185bd7954999b5eb296b1de04caea3 /plugins/audio/audio-pulse.c
parentd73846c8868be1098fb75df83521ba34cfbcad16 (diff)
Fix PulseAudio backend crash with multiple cards
With multiple sound cards, dynamic allocation may have been skipped.o Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'plugins/audio/audio-pulse.c')
-rw-r--r--plugins/audio/audio-pulse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/audio/audio-pulse.c b/plugins/audio/audio-pulse.c
index a19e928b..34643603 100644
--- a/plugins/audio/audio-pulse.c
+++ b/plugins/audio/audio-pulse.c
@@ -303,6 +303,7 @@ void _pulse_enumerate_cards () {
/* it was not ; create it */
if (new_info) {
alsa_info = (alsa_info_T**) realloc (alsa_info, (num+1)*sizeof(alsa_info_T*));
+ alsa_info[num] = (alsa_info_T*) malloc (sizeof(alsa_info_T));
alsa_info[num]->device = strdup (card_name);
asprintf (&alsa_info[num]->synonyms, ":%s", alsa_name);
num++;