GenericGattClient: Fix discovery termination.

The procedure should be terminated whenever the server returns an error not equal
to ATTRIBUTE_NOT_FOUND. The block was effectivelly terminated but the
procedure was not. As a result the discovery was operating on already
freed memory.
pull/6814/head
Vincent Coubard 2018-05-04 11:30:58 +01:00
parent e43d21d4ef
commit fd5903c22d
1 changed files with 1 additions and 0 deletions

View File

@ -147,6 +147,7 @@ struct GenericGattClient::DiscoveryControlBlock : public ProcedureControlBlock {
const AttErrorResponse& error = static_cast<const AttErrorResponse&>(message);
if (error.error_code != AttErrorResponse::ATTRIBUTE_NOT_FOUND) {
terminate(client);
return;
}
switch (error.request_opcode) {