Skip to content
Snippets Groups Projects
Commit 6eaaa923 authored by Yang Gao's avatar Yang Gao Committed by GitHub
Browse files

Merge pull request #11731 from yang-g/cpp_is_hard

Avoid use after free if the sneaky op is owned by the collection
parents 7105fcf1 d03594fb
No related branches found
No related tags found
No related merge requests found
...@@ -551,7 +551,10 @@ class CallOpClientRecvStatus { ...@@ -551,7 +551,10 @@ class CallOpClientRecvStatus {
/// TODO(vjpai): Remove the existence of CallOpSetCollectionInterface /// TODO(vjpai): Remove the existence of CallOpSetCollectionInterface
/// and references to it. This code is deprecated-on-arrival and is /// and references to it. This code is deprecated-on-arrival and is
/// only added for users that bypassed the code-generator. /// only added for users that bypassed the code-generator.
class CallOpSetCollectionInterface {}; class CallOpSetCollectionInterface {
public:
virtual ~CallOpSetCollectionInterface() {}
};
/// An abstract collection of call ops, used to generate the /// An abstract collection of call ops, used to generate the
/// grpc_call_op structure to pass down to the lower layers, /// grpc_call_op structure to pass down to the lower layers,
...@@ -617,9 +620,11 @@ class CallOpSet : public CallOpSetInterface, ...@@ -617,9 +620,11 @@ class CallOpSet : public CallOpSetInterface,
// TODO(vjpai): Remove the reference to collection_ once the idea of // TODO(vjpai): Remove the reference to collection_ once the idea of
// bypassing the code generator is forbidden. It is already deprecated // bypassing the code generator is forbidden. It is already deprecated
grpc_call* call = call_;
collection_.reset(); collection_.reset();
g_core_codegen_interface->grpc_call_unref(call_); g_core_codegen_interface->grpc_call_unref(call);
return true; return true;
} }
......
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