diff --git a/examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp b/examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp index f923d5ec90..212b2ac8d8 100644 --- a/examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp +++ b/examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp @@ -114,7 +114,7 @@ CHIP_ERROR RefrigeratorDoorEventHandler(int argc, char ** argv) RefrigeratorAlarmEventData * data = Platform::New(); data->eventId = Events::Notify::Id; - data->doorState = static_cast(atoi(argv[0])); + data->doorState = static_cast(value); DeviceLayer::PlatformMgr().ScheduleWork(EventWorkerFunction, reinterpret_cast(data)); @@ -172,7 +172,7 @@ void EventWorkerFunction(intptr_t context) ChipLogError(Zcl, "Invalid Event Id %s, line %d", __func__, __LINE__); break; } - // Free memory - Platform::Delete(data); } + // Free memory + Platform::Delete(data); }