[Concept,02/26] boot: pxe: Free bmp in pxe_menu_uninit()

Message ID 20260110202906.187370-3-sjg@u-boot.org
State New
Headers
Series boot: pxe: Add three-phase API and fix memory leaks |

Commit Message

Simon Glass Jan. 10, 2026, 8:28 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The bmp field of pxe_menu is allocated by parse_sliteral() in
parse_menu() but is never freed. Add the missing free() call in
pxe_menu_uninit() to prevent a memory leak.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 boot/pxe_utils.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index 52032d683c3..9444effbb6a 100644
--- a/boot/pxe_utils.c
+++ b/boot/pxe_utils.c
@@ -985,6 +985,7 @@  void pxe_menu_uninit(struct pxe_menu *cfg)
 	free(cfg->title);
 	free(cfg->default_label);
 	free(cfg->fallback_label);
+	free(cfg->bmp);
 
 	list_for_each_safe(pos, n, &cfg->labels) {
 		label = list_entry(pos, struct pxe_label, list);