Skip to content

Commit

Permalink
When reading's value is string type, it will be released prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
ych988 committed Jan 2, 2024
1 parent 1a776ee commit 14f0817
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 14f0817

Please sign in to comment.