Fix the memory leak of muse config parse 00/169000/2 submit/tizen/20180202.020558
authorYoungHun Kim <yh8004.kim@samsung.com>
Thu, 1 Feb 2018 22:57:51 +0000 (07:57 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Thu, 1 Feb 2018 23:01:28 +0000 (08:01 +0900)
Change-Id: I7eea99966c05dd254efb29912dba3c8e7cc77af6

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

index 6ec502b..0924d3a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.31
+Version:    0.3.32
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index b0dc212..37fec6b 100644 (file)
@@ -70,10 +70,16 @@ static int _ms_config_parser(ms_config_t *conf)
        }
 
        str = _ms_config_get_str(conf->muse_dict, MUSE_LOG, NULL);
-       if (str && strncmp(str, MUSE_USE_LOG, strlen(MUSE_USE_LOG)) == 0)
-               conf->log_enabled = TRUE;
-       else
+       if (str) {
+               if (strncmp(str, MUSE_USE_LOG, strlen(MUSE_USE_LOG)) == 0)
+                       conf->log_enabled = TRUE;
+               else
+                       conf->log_enabled = FALSE;
+               free(str);
+       } else {
+               LOGE("[%s] get string error", MUSE_LOG);
                conf->log_enabled = FALSE;
+       }
 
        conf->lockfile = _ms_config_get_str(conf->muse_dict, MUSE_LOCK, NULL);
        if (!conf->lockfile) {