Skip to content

Commit

Permalink
Merge pull request #3 from AlexDayCRL/memory-leak-fix
Browse files Browse the repository at this point in the history
capture msg pointer by reference
  • Loading branch information
AlexDayCRL authored Mar 26, 2024
2 parents b83fc17 + 9fd95b4 commit 2462707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ rmw_publish(
}
});
auto free_msg_bytes = rcpputils::make_scope_exit(
[msg_bytes, allocator, &shmbuf]() {
[&msg_bytes, allocator, &shmbuf]() {
if (msg_bytes && !shmbuf.has_value()) {
allocator->deallocate(msg_bytes, allocator->state);
}
Expand Down

0 comments on commit 2462707

Please sign in to comment.