Files
Sensor-Watch/watch-faces
Konrad Rieck c742e92e7f Fix memory leak in lis2dw_monitor_face settings array
state->settings was malloc'd in lis2dw_monitor_face_setup() outside
the guard that only runs on first allocation of the face's context.
setup() is called again every time the watch wakes from deep sleep
(movement.c's app_setup() re-runs watch_faces[i].setup() for every
face on wake), so each wake cycle allocated a new settings array and
abandoned the previous pointer with no matching free.

Since NUM_SETTINGS is a compile-time constant, make settings a
fixed-size array embedded directly in lis2dw_monitor_state_t instead
of a separately malloc'd pointer, so it's allocated exactly once
along with the rest of the state and never leaks.
2026-07-27 22:11:52 +02:00
..
2026-04-16 11:01:48 -04:00
2026-01-02 20:07:56 -05:00
2026-01-02 20:07:56 -05:00