Improved mixer sort/compare interface.

This commit is contained in:
Jaroslav Kysela 2001-02-12 18:10:31 +00:00
parent 6f3b01b79c
commit 515d1a6415
3 changed files with 70 additions and 18 deletions

View file

@ -134,8 +134,10 @@ static int snd_hctl_elem_add(snd_hctl_t *hctl, snd_hctl_elem_t *elem)
snd_hctl_elem_t **h;
hctl->alloc += 32;
h = realloc(hctl->pelems, sizeof(*h) * hctl->alloc);
if (!h)
if (!h) {
hctl->alloc -= 32;
return -ENOMEM;
}
hctl->pelems = h;
}
if (hctl->count == 0) {