aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/impl/proto_utils.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/grpc++/impl/proto_utils.h b/include/grpc++/impl/proto_utils.h
index bf82f2b23d..9c5f60980a 100644
--- a/include/grpc++/impl/proto_utils.h
+++ b/include/grpc++/impl/proto_utils.h
@@ -36,6 +36,7 @@
#include <type_traits>
+#include <grpc/grpc.h>
#include <grpc++/impl/serialization_traits.h>
#include <grpc++/config_protobuf.h>
#include <grpc++/status.h>
@@ -66,7 +67,9 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
static Status Deserialize(grpc_byte_buffer* buffer,
grpc::protobuf::Message* msg,
int max_message_size) {
- return DeserializeProto(buffer, msg, max_message_size);
+ auto status = DeserializeProto(buffer, msg, max_message_size);
+ grpc_byte_buffer_destroy(buffer);
+ return status;
}
};