From 5905af199670ca34eaaafbd3319d94d230b7e4d4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Mon, 27 May 2019 20:10:52 +0200
Subject: [PATCH 25/25] ucm: another coverity fix in uc_mgr_config_load()
---
src/ucm/utils.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/ucm/utils.c b/src/ucm/utils.c
index efd5a97999b1..5607304e6426 100644
--- a/src/ucm/utils.c
+++ b/src/ucm/utils.c
@@ -85,15 +85,18 @@ int uc_mgr_config_load(const char *file, snd_config_t **cfg)
goto __err2;
}
err = snd_input_close(in);
- if (err < 0)
+ if (err < 0) {
+ in = NULL;
goto __err2;
+ }
*cfg = top;
return 0;
__err2:
- snd_config_delete(top);
+ snd_config_delete(top);
__err1:
- snd_input_close(in);
+ if (in)
+ snd_input_close(in);
return err;
}
--
2.16.4