[CodeClean] fix svace issue accepted/tizen_unified accepted/tizen_unified_x main tizen accepted/tizen/unified/20250313.054746 accepted/tizen/unified/x/20250311.211303
authorJaeyun Jung <jy1210.jung@samsung.com>
Wed, 12 Feb 2025 10:16:11 +0000 (19:16 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Wed, 12 Feb 2025 10:25:40 +0000 (19:25 +0900)
Fix svace issue, node id value with lock.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
daemon/mlops-agent-node.c

index 4b3e97c1802bd4a0b0ccd02519bbccc6a4981893..ad18fce7592ef862ee106cd769de2f29d0df01d9 100755 (executable)
@@ -61,16 +61,18 @@ static int
 _mlops_node_set_pipeline_state (mlops_node_s * node, GstState state)
 {
   GstStateChangeReturn ret;
+  gint64 nid;
 
   g_return_val_if_fail (node != NULL, -EINVAL);
 
   g_mutex_lock (&node->lock);
+  nid = node->id;
   ret = gst_element_set_state (node->element, state);
   g_mutex_unlock (&node->lock);
 
   if (ret == GST_STATE_CHANGE_FAILURE) {
     ml_loge ("Failed to set the state of the pipeline to %s with ID %"
-        G_GINT64_FORMAT, gst_element_state_get_name (state), node->id);
+        G_GINT64_FORMAT, gst_element_state_get_name (state), nid);
     return -ESTRPIPE;
   }