Skip to content

Commit dd4845e

Browse files
author
Kevin Moloney
committed
Fix Klocwork#2081,2082: Uninitialized variable.
* using memset to initialize struct to zero. Signed-off-by: Kevin Moloney <[email protected]>
1 parent 79744c4 commit dd4845e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/CurieBle/src/BleDevice.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ BlePeripheral::getLocalAddress(BleDeviceAddress &address) const
387387
return BLE_STATUS_WRONG_STATE;
388388

389389
ble_addr_t bda;
390+
memset(&bda, 0, sizeof(ble_addr_t));
390391
status = ble_client_gap_get_bda(&bda);
391392
if (BLE_STATUS_SUCCESS != status)
392393
return status;

0 commit comments

Comments
 (0)