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:
orbisai0security 2026-03-26 04:08:00 +00:00
parent e6068c5efe
commit d2560e1b87

View file

@ -118,8 +118,14 @@ esp_err_t display_task_start(void)
if (!buf1 || !buf2) {
ESP_LOGE(TAG, "Failed to allocate LVGL buffers (%u bytes, caps=0x%lx)",
(unsigned)buf_size, (unsigned long)alloc_caps);
if (buf1) free(buf1);
if (buf2) free(buf2);
if (buf1) {
free(buf1);
buf1 = NULL;
}
if (buf2) {
free(buf2);
buf2 = NULL;
}
return ESP_OK;
}
ESP_LOGI(TAG, "LVGL buffers: 2x %u bytes (%u lines, %s)",