Skip to content

Commit

Permalink
[CodeClean] fix svace issue
Browse files Browse the repository at this point in the history
Fix svace issue, change data type to get the path from ml-option.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
  • Loading branch information
jaeyun-jung committed Dec 18, 2023
1 parent 33a8d51 commit 1c65de8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions c/src/ml-api-service-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ ml_service_remote_create (ml_option_h option, ml_service_event_cb cb,
g_autofree _ml_remote_service_s *remote_s = NULL;
g_autofree edge_info_s *edge_info = NULL;
int ret = ML_ERROR_NONE;
void *value;
gchar *_path = NULL;

check_feature_state (ML_FEATURE_SERVICE);
check_feature_state (ML_FEATURE_INFERENCE);
Expand Down Expand Up @@ -609,17 +609,17 @@ ml_service_remote_create (ml_option_h option, ml_service_event_cb cb,
remote_s->node_type = edge_info->node_type;
remote_s->event_cb = cb;
remote_s->user_data = user_data;
if (ML_ERROR_NONE == ml_option_get (option, "path", &value)) {
if (!g_file_test (value, G_FILE_TEST_IS_DIR)) {
if (ML_ERROR_NONE == ml_option_get (option, "path", (void **) (&_path))) {
if (!g_file_test (_path, G_FILE_TEST_IS_DIR)) {
_ml_error_report_return (ML_ERROR_INVALID_PARAMETER,
"The given param, dir path = \"%s\" is invalid or the dir is not found or accessible.",
value);
_path);
}
if (g_access (value, W_OK) != 0) {
if (g_access (_path, W_OK) != 0) {
_ml_error_report_return (ML_ERROR_PERMISSION_DENIED,
"Write permission denied, path: %s", value);
"Write permission denied, path: %s", _path);
}
remote_s->path = g_strdup (value);
remote_s->path = g_strdup (_path);
}

ret = _mlrs_create_edge_handle (remote_s, edge_info);
Expand Down

0 comments on commit 1c65de8

Please sign in to comment.