diff --git a/include/grpcpp/impl/codegen/server_callback_handlers.h b/include/grpcpp/impl/codegen/server_callback_handlers.h index 6c66c42e747a5..11115dd6e9b24 100644 --- a/include/grpcpp/impl/codegen/server_callback_handlers.h +++ b/include/grpcpp/impl/codegen/server_callback_handlers.h @@ -81,7 +81,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { ::grpc::ByteBuffer buf; buf.set_buffer(req); RequestType* request = nullptr; - MessageHolder* allocator_state = nullptr; + MessageHolder* allocator_state; if (allocator_ != nullptr) { allocator_state = allocator_->AllocateMessages(); } else { @@ -98,8 +98,6 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { if (status->ok()) { return request; } - // Clean up on deserialization failure. - allocator_state->Release(); return nullptr; }