Skip to contentSkip to conversation

coverity fix in alsa-libs

PATCH Takashi Iwai 1 participant 1 message Sep 18, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

At Thu, 18 Sep 2014 08:06:18 +0000 (GMT),

Quoted 4 lines · Renu Tyagi

Hi,
I have done the cosmetic changes.
I dont trust my mailers editor so I am attaching it as well :)

Unfortunately your untrusted mailer didn't serve as wished.

The patch itself looks good. Could you post the whole series?

thanks,

Takashi

Quoted 34 lines

Thanks
Renu Tyagi
-----------------------------------------
From 66bbcc5e532c24876bd2fa2bc9d86609679e1062 Mon Sep 17 00:00:00 2001
From: renu tyagi <[email protected]>
Date: Thu, 18 Sep 2014 13:23:51 +0530
Subject: [PATCH] rawmidi : Handle h to be closed in case of error before returning

---
 src/rawmidi/rawmidi.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
src/rawmidi/rawmidi.c +4 -2
index b835b47..ac699b4 100644
@@ -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, &params);
--

1.7.1