Add an exception handling 52/197652/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 15 Jan 2019 02:33:10 +0000 (11:33 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 15 Jan 2019 02:33:10 +0000 (11:33 +0900)
This patch adds checking whether the parameter is nullptr or not.

Change-Id: I35e45198125fecca980257a00421f06c435787ac
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_control.c

index 49bfa7c..75da24a 100644 (file)
@@ -286,6 +286,11 @@ int app_control_create_with_parameters(app_control_h *app_control,
        char *val;
        char *key;
 
+       if (app_control == NULL) {
+               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, "Invalid prameter");
+       }
+
        ret = app_control_create_request(NULL, &tmp_control);
        if (ret != APP_CONTROL_ERROR_NONE)
                return ret;