Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 17, 2017
1 parent 7b1703d commit 1d83a70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cpp/client/secure_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
cb(user_data, md.empty() ? nullptr : &md[0], md.size(),
static_cast<grpc_status_code>(status.error_code()),
status.error_message().c_str());
for (auto it = md.begin(); it != md.end(); ++it) {
grpc_slice_unref(it->key);
grpc_slice_unref(it->value);
}
}

MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
Expand Down

0 comments on commit 1d83a70

Please sign in to comment.