summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-05-23 16:48:17 +0000
committerTakashi Iwai <tiwai@suse.de>2005-05-23 16:48:17 +0000
commit34e3b1c7837b046e21558dfc8957c41e46ea9ea0 (patch)
tree8e533e1bc18877d8ed652d0dd6a05b2aa079d21f
parentb45a11b0ed570bad2cb4f1d7b3c3b809799a5ada (diff)
downloadalsa-utils-34e3b1c7837b046e21558dfc8957c41e46ea9ea0.tar.gz
Fix segfault with no-capture devices
Fix segfault on the device without capture controls when the view is changed to capture mode (bug #1080).
-rw-r--r--alsamixer/alsamixer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c
index 41d4e2b..5af9853 100644
--- a/alsamixer/alsamixer.c
+++ b/alsamixer/alsamixer.c
@@ -1679,12 +1679,12 @@ __again:
if (mixer_type)
free(mixer_type);
- mixer_type = (int *)malloc(sizeof(int) * mixer_n_elems);
+ mixer_type = (int *)calloc(mixer_n_elems, sizeof(int));
if (mixer_type == NULL)
mixer_abort(ERR_FCN, "malloc", 0);
if (mixer_grpidx)
free(mixer_grpidx);
- mixer_grpidx = (int *)malloc(sizeof(int) * mixer_n_elems);
+ mixer_grpidx = (int *)calloc(mixer_n_elems, sizeof(int));
if (mixer_grpidx == NULL)
mixer_abort(ERR_FCN, "malloc", 0);
elem_index = 0;