aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-06-23 16:34:11 -0700
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-06-23 16:34:11 -0700
commit0c82a248480d9f1c1c147e17cfe2966986f49433 (patch)
treeb607df764739d76bfaa0e964dc8cd16ab29e4954
parent6b4fc31f08b9a61a90262379072cffea0bc39795 (diff)
parenta58cab30b2e47f1efdad8cd78b820e818ba30fbb (diff)
Merge pull request #2183 from yang-g/nil
Only copy call details when the status is ok.
-rw-r--r--src/cpp/server/server.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index 31b6a0ee00..f930dbb2b8 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -368,8 +368,11 @@ Server::GenericAsyncRequest::GenericAsyncRequest(
bool Server::GenericAsyncRequest::FinalizeResult(void** tag, bool* status) {
// TODO(yangg) remove the copy here.
- static_cast<GenericServerContext*>(context_)->method_ = call_details_.method;
- static_cast<GenericServerContext*>(context_)->host_ = call_details_.host;
+ if (*status) {
+ static_cast<GenericServerContext*>(context_)->method_ =
+ call_details_.method;
+ static_cast<GenericServerContext*>(context_)->host_ = call_details_.host;
+ }
gpr_free(call_details_.method);
gpr_free(call_details_.host);
return BaseAsyncRequest::FinalizeResult(tag, status);