Fix memory leak issue 03/121103/3 accepted/tizen/3.0/common/20170327.141340 accepted/tizen/3.0/ivi/20170327.104923 accepted/tizen/3.0/mobile/20170327.104859 accepted/tizen/3.0/tv/20170327.104908 accepted/tizen/3.0/wearable/20170327.104914 submit/tizen_3.0/20170327.074012
authorYunmi Ha <yunmi.ha@samsung.com>
Mon, 27 Mar 2017 06:58:44 +0000 (15:58 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Mon, 27 Mar 2017 07:22:43 +0000 (16:22 +0900)
Change-Id: Ib2c6f239f055af390940e957a9a676f55ce16081
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/utils/tlm-launcher.c

index 51546f67c42f2886fe71a39baa347643f728b382..1770599f43f86a46e66d75811111bad11e7ade28 100755 (executable)
@@ -157,7 +157,7 @@ static void _tlm_launcher_process (TlmLauncher *l)
     cmd = g_strstrip (cmd + 2);
     switch (control) {
       case 'M':
-      case 'L':
+      case 'L': {
         argv = tlm_utils_split_command_line (cmd);
         if (!argv)
           ERR("Getting argv failure");
@@ -175,6 +175,7 @@ static void _tlm_launcher_process (TlmLauncher *l)
           ChildInfo *info = g_slice_new0 (ChildInfo);
           if (!info) {
             CRITICAL("g_slice_new0 memory allocation failure");
+            if (argv) g_strfreev(argv);
             break;
           }
           info->pid = child_pid;
@@ -183,6 +184,8 @@ static void _tlm_launcher_process (TlmLauncher *l)
           g_hash_table_insert (l->childs,
               GINT_TO_POINTER(child_pid), info);
         }
+        if (argv)   g_strfreev(argv);
+        }
         break;
       case 'W': {
         gchar **sockets = g_strsplit(cmd, ",", -1);