Fix memory leak 11/111411/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 20 Jan 2017 08:30:32 +0000 (17:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 20 Jan 2017 08:30:46 +0000 (17:30 +0900)
Change-Id: I6dfa71dd1baebac7c12725badf15459b29b13204
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/widget_app.c

index 3b85e32..b3c18c5 100755 (executable)
@@ -973,6 +973,11 @@ static void __after_loop()
                package_id = NULL;
        }
 
+       if (appid) {
+               free(appid);
+               appid = NULL;
+       }
+
        elm_shutdown();
 }
 
@@ -1148,8 +1153,13 @@ EXPORT_API int widget_app_main(int argc, char **argv,
        app_ops = callback;
        app_user_data = user_data;
        r = __before_loop(argc, argv);
-       if (r < 0)
+       if (r < 0) {
+               if (appid) {
+                       free(appid);
+                       appid = NULL;
+               }
                return r;
+       }
 
        ecore_main_loop_begin();
        aul_status_update(STATUS_DYING);
@@ -1538,6 +1548,7 @@ EXPORT_API int widget_app_context_set_content_info(widget_context_h context,
        else
                context->content = NULL;
 
+       free(raw);
        if (ret < 0) {
                /* LCOV_EXCL_START */
                _E("failed to send content info: %s of %s (%d)", context->id,