diff options
Diffstat (limited to 'alsa-binding/Alsa-SetGet.c')
-rw-r--r-- | alsa-binding/Alsa-SetGet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alsa-binding/Alsa-SetGet.c b/alsa-binding/Alsa-SetGet.c index 2083a53..1b7d4a8 100644 --- a/alsa-binding/Alsa-SetGet.c +++ b/alsa-binding/Alsa-SetGet.c @@ -655,7 +655,7 @@ STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req request) { const char *warmsg = NULL; int err = 0, status = 0, done; unsigned int ctlCount; - snd_ctl_t *ctlDev; + snd_ctl_t *ctlDev=NULL; snd_ctl_elem_list_t *ctlList; queryValuesT queryValues; json_object *queryJ, *numidsJ, *sndctls; @@ -799,8 +799,10 @@ STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req request) { // send response+warning if any afb_req_success(request, sndctls, warmsg); snd_ctl_elem_list_clear(ctlList); + // use OnErrorExit OnErrorExit: + if (ctlDev) snd_ctl_close(ctlDev); return; } |