summaryrefslogtreecommitdiffstats
path: root/alsa-binding
diff options
context:
space:
mode:
Diffstat (limited to 'alsa-binding')
-rw-r--r--alsa-binding/Alsa-SetGet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/alsa-binding/Alsa-SetGet.c b/alsa-binding/Alsa-SetGet.c
index b0b8949..29c82b3 100644
--- a/alsa-binding/Alsa-SetGet.c
+++ b/alsa-binding/Alsa-SetGet.c
@@ -767,7 +767,7 @@ STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req_t request) {
if ((err = snd_ctl_elem_list(ctlDev, ctlList)) < 0) {
afb_req_fail_f(request, "listOpen-failed", "devid='%s' load fail error=%s\n", queryValues.devid, snd_strerror(err));
- goto OnErrorExit;
+ goto fail_space;
}
// Parse numids string (empty == all)
@@ -869,9 +869,12 @@ STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req_t request) {
// send response+warning if any
afb_req_success(request, sndctls, warmsg);
- snd_ctl_elem_list_clear(ctlList);
+
// use OnErrorExit
+fail_space:
+ snd_ctl_elem_list_free_space(ctlList);
+ snd_ctl_elem_list_clear(ctlList);
OnErrorExit:
if (ctlDev) snd_ctl_close(ctlDev);
return;