Skip to content

gps: fix sproradic crash due to uninitialized memory

Commit 13473aa7 ("gps: Re-register callbacks in start_positioning") make HAL::Impl::register_callbacks() check if gps_handle exists so that it can delete it. But because the constructor doesn't initialize that variable, the check always succeed when called the first time in the constructor, leading to calling free() with invalid memory.

Initialize that value first with nullptr, so that the first call doesn't delete the uninitialized handle.

Fixes: 13473aa7 ("gps: Re-register callbacks in start_positioning")
Fixes: #16 (closed)

Merge request reports