diff --git a/rmw_zenoh_cpp/src/detail/rmw_data_types.cpp b/rmw_zenoh_cpp/src/detail/rmw_data_types.cpp index c08b55d5..9e795251 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_data_types.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_data_types.cpp @@ -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", diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index 1b64195f..65165f0e 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -2532,6 +2532,7 @@ rmw_send_response( query_ptr, z_query_keyexpr(query_ptr), reinterpret_cast( response_bytes), data_length + meta_length, &options); + z_drop(z_move(*owned_query_ptr)); return RMW_RET_OK; }