Browse Source

Fix the memory leak issue in the strdup function.

pull/2140/head
Quency-D 3 months ago
parent
commit
65752fef72
  1. 3
      examples/simple_repeater/UITask.cpp
  2. 3
      examples/simple_room_server/UITask.cpp
  3. 3
      examples/simple_sensor/UITask.cpp

3
examples/simple_repeater/UITask.cpp

@ -37,7 +37,8 @@ void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* fi
}
// v1.2.3 (1 Jan 2025)
sprintf(_version_info, "%s (%s)", version, build_date);
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
free(version);
}
void UITask::renderCurrScreen() {

3
examples/simple_room_server/UITask.cpp

@ -37,7 +37,8 @@ void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* fi
}
// v1.2.3 (1 Jan 2025)
sprintf(_version_info, "%s (%s)", version, build_date);
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
free(version);
}
void UITask::renderCurrScreen() {

3
examples/simple_sensor/UITask.cpp

@ -37,7 +37,8 @@ void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* fi
}
// v1.2.3 (1 Jan 2025)
sprintf(_version_info, "%s (%s)", version, build_date);
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
free(version);
}
void UITask::renderCurrScreen() {

Loading…
Cancel
Save