[Bluetooth] Fixing the memory releasing issue 59/189759/2
authorPiotr Kosko <p.kosko@samsung.com>
Thu, 20 Sep 2018 06:40:06 +0000 (08:40 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Thu, 20 Sep 2018 07:12:15 +0000 (09:12 +0200)
[Verification] Code compiles without errors.
  TCT passrate 100%.

Change-Id: I4a7b516635b7d2a3bfc96359fa4d51543b0eb4e0
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
src/bluetooth/bluetooth_health_profile_handler.cc

index 2aeacb582f3300ced2ea5f3c5c2b05e55127dda6..06a1f906507a0191f09933e1d96c24abd69eb1bd 100644 (file)
@@ -238,6 +238,7 @@ void BluetoothHealthProfileHandler::RegisterSinkApp(const picojson::value& data,
     switch (ret) {
       case BT_ERROR_NONE: {
         LoggerD("Registered app: %s", app_id);
+        std::unique_ptr<char, void (*)(void*)> app_id_ptr(app_id, &std::free);
 
         this->registered_health_apps_.insert(app_id);