Skip to contentSkip to conversation

coverity fix in alsa-libs

DISCUSSION Renu Tyagi 1 participant 1 message Sep 18, 2014

lore
Share & tools
lore

Renu Tyagi

author
#0 lore raw

Hi,

Sorry for the spam mail. I am sending the mail in plain text now. PFA patch.
File in which changes are being made : rawmidi.c
Bug type - Handle h to be closed in case of error before returning Meanwhile I am looking into the matter why my mails are not visible in ML.

Thanks
Renu Tyagi

From ea6ea1452b0368c25ce41ea4434c29d553912fe3 Mon Sep 17 00:00:00 2001
From: renu555 <[email protected]>
Date: Wed, 17 Sep 2014 16:45:27 +0530
Subject: [PATCH 1/8] 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 -1
index b835b47..0ca5d1f 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);
Signature · 1 line
1.7.1