Skip to content

Commit

Permalink
[chip-tool] Cancel the CHIPCallbacks when the chip-tool ends up to av…
Browse files Browse the repository at this point in the history
…oid a use-after-free if there is a timeout trying to get the device (#15914)
  • Loading branch information
vivien-apple authored and pull[bot] committed Nov 14, 2023
1 parent 2627803 commit ddeea3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/chip-tool/commands/clusters/ModelCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class ModelCommand : public CHIPCommand
return CHIP_ERROR_BAD_REQUEST;
};

void Shutdown() override
{
mOnDeviceConnectedCallback.Cancel();
mOnDeviceConnectionFailureCallback.Cancel();
}

private:
chip::NodeId mNodeId;
std::vector<chip::EndpointId> mEndPointId;
Expand Down

0 comments on commit ddeea3c

Please sign in to comment.