Skip to content

Commit

Permalink
fix:When reading's value is string type, it will be released prematur…
Browse files Browse the repository at this point in the history
…ely (#506)

Signed-off-by: yangc <[email protected]>
  • Loading branch information
ych988 committed Jan 16, 2024
1 parent cc49468 commit c533cd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/c/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ edgex_event_cooked *edgex_data_process_event
iot_data_string_map_add (rmap, "objectValue", iot_data_copy (values[i].value));
break;
case IOT_DATA_STRING:
iot_data_string_map_add (rmap, "value", iot_data_alloc_string (iot_data_string (values[i].value), IOT_DATA_REF));
iot_data_string_map_add (rmap, "value", iot_data_alloc_string (iot_data_string (values[i].value), IOT_DATA_COPY));
break;
default:
iot_data_string_map_add (rmap, "value", iot_data_alloc_string (iot_data_to_json (values[i].value), IOT_DATA_TAKE));
Expand Down

0 comments on commit c533cd2

Please sign in to comment.