Add a null checker 91/225191/2 submit/tizen/20200218.055441
authorsooyeon.kim <sooyeon.kim@samsung.com>
Tue, 18 Feb 2020 05:33:36 +0000 (14:33 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Tue, 18 Feb 2020 05:52:17 +0000 (14:52 +0900)
Change-Id: If9508e574b0466d0f46217a9a3cc26d552dbde0d
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
common/vc_json_parser.c

index 65957db2ef6504a325951a4468e705951719aec0..d6be24536d83779be85820374e6a48c33f2cfc35 100644 (file)
@@ -184,7 +184,9 @@ static int __vc_json_set_commands(JsonObject *root_obj, int type, char* invocati
                cmd->domain = temp;
 
                temp_text = json_object_get_string_member(object, "cmd");
-               cmd->command = strdup(temp_text);
+               if (NULL != temp_text)
+                       cmd->command = strdup(temp_text);
+
                if (NULL == cmd->command) {
                        SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] Fail to allocate memory");
                        free(temp_type);