Skip to content

Commit

Permalink
fix: copy attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Jun 14, 2024
1 parent e8c4e29 commit 6e455e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/net/reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ _z_reply_t _z_reply_create(_z_keyexpr_t keyexpr, z_reply_tag_t tag, _z_id_t id,
_z_slice_copy(&sample.payload._slice, payload);
sample.kind = kind;
sample.timestamp = _z_timestamp_duplicate(timestamp);
sample.attachment = att; // FIXME: call z_attachment_move or copy
sample.attachment = _z_bytes_duplicate(&att);

// Create sample rc from value
reply.data.sample = _z_sample_rc_new_from_val(sample);
Expand Down
2 changes: 1 addition & 1 deletion src/net/sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ _z_sample_t _z_sample_create(const _z_keyexpr_t *key, const _z_slice_t *payload,
s.kind = kind;
s.timestamp = timestamp;
s.qos = qos;
s.attachment = att; // FIXME: call z_attachment_move or copy
s.attachment = _z_bytes_duplicate(&att);
return s;
}
#else
Expand Down

0 comments on commit 6e455e0

Please sign in to comment.