Skip to content

Commit

Permalink
Fixes memory leak.
Browse files Browse the repository at this point in the history
Signed-off-by: Franco Cipollone <[email protected]>
  • Loading branch information
francocipollone committed Dec 26, 2023
1 parent 6ec1fb7 commit d24c3cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rmw_zenoh_cpp/src/detail/rmw_data_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,20 @@ void client_data_handler(z_owned_reply_t * reply, void * client_data)
"[client_data_handler] triggered for %s",
rmw_client_data->service_name
);
if (!z_reply_check(reply)) {
if (!z_check(*reply)) {
RCUTILS_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"z_check returned False"
);
return;
}
if (!z_reply_check(reply)) {
RCUTILS_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"z_reply_check returned False"
);
return;
}
if (!z_reply_is_ok(reply)) {
RCUTILS_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
Expand Down
1 change: 1 addition & 0 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,7 @@ rmw_send_response(
query_ptr, z_query_keyexpr(query_ptr), reinterpret_cast<const uint8_t *>(
response_bytes), data_length + meta_length, &options);

z_drop(z_move(*owned_query_ptr));
return RMW_RET_OK;
}

Expand Down

0 comments on commit d24c3cd

Please sign in to comment.