mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
DataFlash: use calloc in MAVLink backend
This commit is contained in:
parent
8dae3fe59b
commit
c9deabc283
@ -35,7 +35,7 @@ void DataFlash_MAVLink::Init()
|
||||
|
||||
_blocks = nullptr;
|
||||
while (_blockcount >= 8) { // 8 is a *magic* number
|
||||
_blocks = (struct dm_block *) malloc(_blockcount * sizeof(_blocks[0]));
|
||||
_blocks = (struct dm_block *) calloc(_blockcount, sizeof(_blocks[0]));
|
||||
if (_blocks != nullptr) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user