diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-05 08:45:45 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-05 08:45:45 -0700 |
commit | 928ec8ee51faf0e57fbc084d6da04d1f85704e07 (patch) | |
tree | 6754af9f738ce83771abdf92842ccfaf67b268d4 /include | |
parent | 8f789fd4b99cebeecbbb683d37278b508d5ec7a7 (diff) |
Fix memory leak
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/proto_utils.h | 5 |
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; } }; |