Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03bc5bd6 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Protect the btif config state with a lock during cleanup

Bug: 64186300
Test: Code compilation, enable/disable Bluetooth
Change-Id: Ic2397a128d59c9cc69cbd8252734b69eb7c02501
parent 819b843f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -224,8 +224,10 @@ static future_t* clean_up(void) {
  btif_config_flush();

  alarm_free(config_timer);
  config_free(config);
  config_timer = NULL;

  std::unique_lock<std::mutex> lock(config_lock);
  config_free(config);
  config = NULL;
  return future_new_immediate(FUTURE_SUCCESS);
}