Skip to content

Commit 9ca8cc1

Browse files
fix: resolve the memory leak in the string deserialization (#363)
* 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>
1 parent b8d1c9f commit 9ca8cc1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/zenoh/api/ext/serialization.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ inline bool __zenoh_deserialize_with_deserializer(zenoh::ext::Deserializer& dese
278278
__ZENOH_RESULT_CHECK(::ze_deserializer_deserialize_string(interop::as_copyable_c_ptr(deserializer), &s), err,
279279
"Deserialization failure");
280280
value = std::string(::z_string_data(::z_loan(s)), ::z_string_len(::z_loan(s)));
281+
::z_drop(::z_move(s));
281282
return err == nullptr || *err == Z_OK;
282283
}
283284

0 commit comments

Comments
 (0)