[alsa-devel] [PATCH] coverity fix in alsa-libs

Renu Tyagi renu.tyagi at samsung.com
Thu Sep 18 10:06:17 CEST 2014


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

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


Signed-off-by: renu tyagi <renu.tyagi at samsung.com>
---
 src/rawmidi/rawmidi.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

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, &params);
--
1.7.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch22578.patch
Type: application/octet-stream
Size: 947 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140918/5078663f/attachment.obj>


More information about the Alsa-devel mailing list