Fix coverity issue 44/275844/2 accepted/tizen/unified/20220608.140031 submit/tizen/20220607.004037
authorYoungHun Kim <yh8004.kim@samsung.com>
Fri, 3 Jun 2022 00:43:45 +0000 (09:43 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Fri, 3 Jun 2022 02:54:51 +0000 (11:54 +0900)
 - FORWARD_NULL

Change-Id: I85c115161d608604c3b5679a7e9c0adc7c42c397

packaging/mused.spec
server/src/muse_server_config.c

index 5d3c148..c0a55fa 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.150
+Version:    0.3.151
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 1641c6b..9e888f2 100644 (file)
@@ -71,13 +71,13 @@ static int _ms_config_parser(ms_config_t *conf)
        }
 
        conf->logfile = _ms_config_get_str(conf->muse_dict, MUSE_LOG, NULL);
-       if (conf->logfile)
+       if (conf->logfile) {
                conf->log_enabled = (strncmp(conf->logfile, MUSE_USE_LOG, strlen(MUSE_USE_LOG) == 0));
-       else
+               muse_core_remove_symlink(conf->logfile);
+               conf->fd = open(conf->logfile, O_CREAT | O_APPEND | O_WRONLY | O_NONBLOCK, 0644);
+       } else {
                conf->log_enabled = FALSE;
-
-       muse_core_remove_symlink(conf->logfile);
-       conf->fd = open(conf->logfile, O_CREAT | O_APPEND | O_WRONLY | O_NONBLOCK, 0644);
+       }
 
        conf->lockfile = _ms_config_get_str(conf->muse_dict, MUSE_LOCK, NULL);
        if (!conf->lockfile) {