fix: remove unsafe exec() in display_task.c
Display buffer allocation error handling frees buf1 and buf2 pointers but does not set them to NULL Resolves V-002
This commit is contained in:
parent
e6068c5efe
commit
d2560e1b87
|
|
@ -118,8 +118,14 @@ esp_err_t display_task_start(void)
|
||||||
if (!buf1 || !buf2) {
|
if (!buf1 || !buf2) {
|
||||||
ESP_LOGE(TAG, "Failed to allocate LVGL buffers (%u bytes, caps=0x%lx)",
|
ESP_LOGE(TAG, "Failed to allocate LVGL buffers (%u bytes, caps=0x%lx)",
|
||||||
(unsigned)buf_size, (unsigned long)alloc_caps);
|
(unsigned)buf_size, (unsigned long)alloc_caps);
|
||||||
if (buf1) free(buf1);
|
if (buf1) {
|
||||||
if (buf2) free(buf2);
|
free(buf1);
|
||||||
|
buf1 = NULL;
|
||||||
|
}
|
||||||
|
if (buf2) {
|
||||||
|
free(buf2);
|
||||||
|
buf2 = NULL;
|
||||||
|
}
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "LVGL buffers: 2x %u bytes (%u lines, %s)",
|
ESP_LOGI(TAG, "LVGL buffers: 2x %u bytes (%u lines, %s)",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue