From c9deabc283f0b5800800fbd768806dbc45542865 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Jan 2018 08:05:34 +1100 Subject: [PATCH] DataFlash: use calloc in MAVLink backend --- libraries/DataFlash/DataFlash_MAVLink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/DataFlash/DataFlash_MAVLink.cpp b/libraries/DataFlash/DataFlash_MAVLink.cpp index 3650d9fa13..46dfc8fcc7 100644 --- a/libraries/DataFlash/DataFlash_MAVLink.cpp +++ b/libraries/DataFlash/DataFlash_MAVLink.cpp @@ -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; }