aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-05 08:45:45 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-05 08:45:45 -0700
commit928ec8ee51faf0e57fbc084d6da04d1f85704e07 (patch)
tree6754af9f738ce83771abdf92842ccfaf67b268d4 /include
parent8f789fd4b99cebeecbbb683d37278b508d5ec7a7 (diff)
Fix memory leak
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;
}
};