修改内存泄漏问题
This commit is contained in:
parent
35e035b8b1
commit
649f75f861
|
@ -430,10 +430,12 @@ int rt_hw_sensor_register(rt_sensor_t sensor,
|
|||
result = rt_device_register(device, device_name, flag | RT_DEVICE_FLAG_STANDALONE);
|
||||
if (result != RT_EOK)
|
||||
{
|
||||
rt_free(device_name);
|
||||
LOG_E("rt_sensor register err code: %d", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
rt_free(device_name);
|
||||
LOG_I("rt_sensor init success");
|
||||
return RT_EOK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue