Skip to content

Commit fd5903c

Browse files
committed
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.
1 parent e43d21d commit fd5903c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/FEATURE_BLE/source/generic/GenericGattClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct GenericGattClient::DiscoveryControlBlock : public ProcedureControlBlock {
147147
const AttErrorResponse& error = static_cast<const AttErrorResponse&>(message);
148148
if (error.error_code != AttErrorResponse::ATTRIBUTE_NOT_FOUND) {
149149
terminate(client);
150+
return;
150151
}
151152

152153
switch (error.request_opcode) {

0 commit comments

Comments
 (0)