Fix static issues 35/252535/5
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 29 Jan 2021 06:33:38 +0000 (15:33 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 1 Feb 2021 06:02:54 +0000 (15:02 +0900)
Change-Id: Iac470c9767b7fe9c2ad9934d3022967d3ac0d197
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app-control/app_control.c

index 3a9aaecd7f3b82ccc5aa0af0315b0824895525e9..657a1096b5367025520e1450ad669ab4ccd2cc63 100644 (file)
@@ -814,8 +814,12 @@ EXPORT_API int app_control_create_event(bundle *data, struct app_control_s **app
 
        app_control_event->type = APP_CONTROL_TYPE_EVENT;
        app_control_event->data = bundle_dup(data);
-       app_control_event->id = app_control_new_id();
+       if (app_control_event->data == NULL) {
+               free(app_control_event);
+               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to copy bundle data");
+       }
 
+       app_control_event->id = app_control_new_id();
        operation = aul_svc_get_operation(app_control_event->data);
        if (operation == NULL)
                aul_svc_set_operation(app_control_event->data, APP_CONTROL_OPERATION_DEFAULT);