fix svace issue.
authorSuYeon <suyeon5.kim@samsung.com>
Wed, 14 Jun 2023 02:22:18 +0000 (11:22 +0900)
committergichan-jang <56856496+gichan-jang@users.noreply.github.com>
Wed, 14 Jun 2023 05:46:33 +0000 (14:46 +0900)
error param should be paased to 'json_parser_load_from_data' since error_report acess to error message.

Signed-off-by: SuYeon <suyeon5.kim@samsung.com>
c/src/ml-api-service-agent-client.c

index 735519d..77e7f48 100644 (file)
@@ -52,8 +52,9 @@ _build_ml_opt_from_json_cstr (const gchar * jcstring, ml_option_h * opt)
     return ML_ERROR_OUT_OF_MEMORY;
   }
 
-  if (!json_parser_load_from_data (parser, jcstring, -1, NULL)) {
-    _ml_error_report ("Failed to parse the json string. %s", err->message);
+  if (!json_parser_load_from_data (parser, jcstring, -1, &err)) {
+    _ml_error_report ("Failed to parse the json string. %s",
+        err ? err->message : "unknown error");
     return ML_ERROR_INVALID_PARAMETER;
   }