Create and populate the VOR service report message as before, but delete it
when the feature message queue is not available.
The message is normally transferred to `m_msgQueueToFeature` for ownership,
but when the queue is null there is no owner and the allocated message leaked.
Coverity reported the leak as CID 652338 (`RESOURCE_LEAK`) while analyzing
`VorLocalizerWorker::rrNextTurn()`. Review of the surrounding message queue
usage confirmed that queued messages are owned by the queue, making the
missing-queue path the unhandled ownership case.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Add a destructor to ObjectMapItem to release its owned m_aircraftState.
ObjectMapItem allocates m_aircraftState when aircraft state is present,
but had no corresponding cleanup when the map item was destroyed.
Coverity reported the allocation as a constructor/destructor resource
leak.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Coverity reported an uninitialized m_rx2txGPIOEnable value when it was
used by SimplePTTGUI before settings were loaded. Initialize the setting
in resetToDefaults() to provide a defined default value.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The channel count comparison in getChannelsByDevice() accidentally used
the first plan's channel count for both operands. This caused the comparator
to always treat the channel counts as equal and sort only by bandwidth.
Use the second plan's channel count when comparing RRTurnPlans so plans are
ordered correctly by number of channels before applying the bandwidth
tie-breaker.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
cppcheck reported that the displayTableSettings() declaration argument
order differed from the function definition. The header declared the
arguments as (columnIndexes, columnSizes), while the implementation and
all call sites use (columnSizes, columnIndexes).
Update the declaration to match the implementation and remove ambiguity
between the table column width and ordering arrays.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the coordinate and bearing variables used by
VORModel::findIntersection() and declare the validity flags as bool.
Coverity reported that lat1, lon1, bearing1, lat2, lon2, and bearing2
could be passed uninitialized to calcIntersectionPoint(). While the
current control flow is intended to assign these values before the
corresponding validity flag is set, they were not initialized at
declaration, leaving undefined behavior if that invariant were ever
broken.
Initializing the variables removes the possibility of using
indeterminate values, satisfies static analysis, and makes the code
more robust against future modifications. The validity flags are also
changed from float to bool to match their intended use.
Signed-off-by: Robin Getz <rgetz503@gmail.com>