Skip to content

Commit

Permalink
Fix return values
Browse files Browse the repository at this point in the history
  • Loading branch information
quen0n committed Jun 12, 2024
1 parent 11f42a5 commit de97ad1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,14 @@ Sensor* unitemp_sensor_alloc(char* name, const SensorType* type, char* args) {
Sensor* sensor = malloc(sizeof(Sensor));
if(sensor == NULL) {
FURI_LOG_E(APP_NAME, "Sensor %s allocation error", name);
return false;
return NULL;
}

//Выделение памяти под имя
sensor->name = malloc(11);
if(sensor->name == NULL) {
FURI_LOG_E(APP_NAME, "Sensor %s name allocation error", name);
return false;
return NULL;
}
//Запись имени датчка
strcpy(sensor->name, name);
Expand Down

0 comments on commit de97ad1

Please sign in to comment.