aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-11-07 19:00:37 +0100
committercbdev <cb@cbcdn.com>2019-11-07 19:00:37 +0100
commit988bcbe79115e55929390bcac5493abb4ca20011 (patch)
treeac1f97509215c5e794e35ed27a0dccd2d81da0ea
parent350f0d2d2eaff5f0d57b09857102e2df1e96d733 (diff)
downloadmidimonster-988bcbe79115e55929390bcac5493abb4ca20011.tar.gz
midimonster-988bcbe79115e55929390bcac5493abb4ca20011.tar.bz2
midimonster-988bcbe79115e55929390bcac5493abb4ca20011.zip
Only fclose configuration file if it has been opened previously (Coverity CID 350443)
-rw-r--r--config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/config.c b/config.c
index ddee720..8e7e581 100644
--- a/config.c
+++ b/config.c
@@ -491,7 +491,9 @@ int config_read(char* cfg_filepath){
rv = 0;
bail:
free(source_dir);
- fclose(source);
+ if(source){
+ fclose(source);
+ }
free(line_raw);
return rv;
}