Skip to content
Snippets Groups Projects
Commit a58cab30 authored by yang-g's avatar yang-g
Browse files

release memory even if the status is false

parent 3deb0069
No related branches found
No related tags found
No related merge requests found
...@@ -369,11 +369,12 @@ Server::GenericAsyncRequest::GenericAsyncRequest( ...@@ -369,11 +369,12 @@ Server::GenericAsyncRequest::GenericAsyncRequest(
bool Server::GenericAsyncRequest::FinalizeResult(void** tag, bool* status) { bool Server::GenericAsyncRequest::FinalizeResult(void** tag, bool* status) {
// TODO(yangg) remove the copy here. // TODO(yangg) remove the copy here.
if (*status) { if (*status) {
static_cast<GenericServerContext*>(context_)->method_ = call_details_.method; static_cast<GenericServerContext*>(context_)->method_ =
call_details_.method;
static_cast<GenericServerContext*>(context_)->host_ = call_details_.host; static_cast<GenericServerContext*>(context_)->host_ = call_details_.host;
gpr_free(call_details_.method);
gpr_free(call_details_.host);
} }
gpr_free(call_details_.method);
gpr_free(call_details_.host);
return BaseAsyncRequest::FinalizeResult(tag, status); return BaseAsyncRequest::FinalizeResult(tag, status);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment