Skip to content

Commit

Permalink
fix: resolve the memory leak in the string deserialization (#363)
Browse files Browse the repository at this point in the history
* fix: resolve the memory leak in the string deserialization

* chore: apply the suggestion

Co-authored-by: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com>

---------

Co-authored-by: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com>
  • Loading branch information
YuanYuYuan and DenisBiryukov91 authored Jan 8, 2025
1 parent b8d1c9f commit 9ca8cc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/zenoh/api/ext/serialization.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ inline bool __zenoh_deserialize_with_deserializer(zenoh::ext::Deserializer& dese
__ZENOH_RESULT_CHECK(::ze_deserializer_deserialize_string(interop::as_copyable_c_ptr(deserializer), &s), err,
"Deserialization failure");
value = std::string(::z_string_data(::z_loan(s)), ::z_string_len(::z_loan(s)));
::z_drop(::z_move(s));
return err == nullptr || *err == Z_OK;
}

Expand Down

0 comments on commit 9ca8cc1

Please sign in to comment.