AP_Mission: fixed valgrind error on writing mission items

This commit is contained in:
Andrew Tridgell 2019-06-24 19:35:21 +10:00 committed by Randy Mackay
parent e4761e1ee4
commit 5ac2aad2f8
1 changed files with 2 additions and 2 deletions

View File

@ -522,7 +522,7 @@ bool AP_Mission::read_cmd_from_storage(uint16_t index, Mission_Command& cmd) con
// read WP position
uint16_t pos_in_storage = 4 + (index * AP_MISSION_EEPROM_COMMAND_SIZE);
PackedContent packed_content;
PackedContent packed_content {};
uint8_t b1 = _storage.read_byte(pos_in_storage);
if (b1 == 0) {
@ -599,7 +599,7 @@ bool AP_Mission::write_cmd_to_storage(uint16_t index, const Mission_Command& cmd
return false;
}
PackedContent packed;
PackedContent packed {};
if (stored_in_location(cmd.id)) {
// Location is not PACKED; field-wise copy it:
packed.location.flags.relative_alt = cmd.content.location.relative_alt;