diff mbox

[4/11] rawmidi : close handle h

Message ID 59.55.05230.8240C145@epcpsbgx3.samsung.com (mailing list archive)
State Accepted
Delegated to: Takashi Iwai
Headers show

Commit Message

Renu Tyagi Sept. 19, 2014, 10:23 a.m. UTC
Signed-off-by: renu tyagi 

---
src/rawmidi/rawmidi.c |    5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

--
1.7.1
diff mbox

Patch

diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c
index b835b47..ac699b4 100644
--- a/src/rawmidi/rawmidi.c
+++ b/src/rawmidi/rawmidi.c
@@ -256,8 +256,11 @@  static int snd_rawmidi_open_conf(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp
                snd_config_delete(type_conf);
        if (err >= 0)
                err = open_func(inputp, outputp, name, rawmidi_root, rawmidi_conf, mode);
-       if (err < 0)
+       if (err < 0) {
+               if (h)
+                       snd_dlclose(h);
                return err;
+       }
        if (inputp) {
                (*inputp)->dl_handle = h; h = NULL;
                snd_rawmidi_params_default(*inputp, ¶ms);