Fix memory leak 27/113727/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 8 Feb 2017 12:10:10 +0000 (21:10 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 8 Feb 2017 12:10:10 +0000 (21:10 +0900)
Change-Id: I5e79c6d4961869b34feb631a8717d3b26604970c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_com.c
tool/app_group_info.c
tool/app_launcher.c

index a43e935..5605e39 100644 (file)
@@ -78,8 +78,12 @@ API aul_app_com_permission_h aul_app_com_permission_create()
 
 API void aul_app_com_permission_destroy(aul_app_com_permission_h permission)
 {
-       if (permission)
-               g_free(permission);
+       if (permission == NULL)
+               return;
+
+       if (permission->privilege)
+               g_free(permission->privilege);
+       g_free(permission);
 }
 
 API int aul_app_com_permission_set_propagation(aul_app_com_permission_h permission, aul_app_com_propagate_option_e option)
index 7138466..d5b36dc 100644 (file)
@@ -89,6 +89,8 @@ static int print_info(void)
                }
                printf("==================================\n");
                printf("\n");
+               free(member_pids);
+               member_pids = NULL;
        }
 
 FINISH:
index c375ee8..45095ac 100644 (file)
@@ -190,6 +190,7 @@ static gboolean run_func(void *data)
                aul_svc_set_operation(kb, AUL_SVC_OPERATION_DEFAULT);
                aul_svc_set_appid(kb, (char *)launch_arg_data->appid);
                pid = aul_svc_run_service_for_uid(kb, 0, __reply_cb_func, (void*)NULL, uid);
+               bundle_free(kb);
                if (pid <= 0) {
                        printf("... launch failed\n");
                        g_main_loop_quit(mainloop);