U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: image-host: Fix potential memory leak
@ 2025-04-18  8:32 ant.v.moryakov
  0 siblings, 0 replies; 5+ messages in thread
From: ant.v.moryakov @ 2025-04-18  8:32 UTC (permalink / raw)
  To: u-boot; +Cc: Maks Mishin

From: Maks Mishin <maks.mishinFZ@gmail.com>

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
---
 tools/image-host.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/image-host.c b/tools/image-host.c
index 4a24dee8..453cd38f 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1029,10 +1029,13 @@ static int fit_config_process_sig(const char *keydir, const char *keyfile,
 				   &region_proplen))
 		return -1;
 
-	if (fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
+	ret = fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
 				require_keys ? "conf" : NULL, engine_id,
-				algo_name))
+				algo_name);
+	if (ret) {
+		free(info.name);
 		return -1;
+	}
 
 	ret = info.crypto->sign(&info, region, region_count, &value,
 				&value_len);
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] tools: image-host: Fix potential memory leak
@ 2025-04-18  8:30 ant.v.moryakov
  2025-04-18 13:52 ` Quentin Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: ant.v.moryakov @ 2025-04-18  8:30 UTC (permalink / raw)
  To: u-boot; +Cc: Maks Mishin

From: Maks Mishin <maks.mishinFZ@gmail.com>

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
---
 tools/image-host.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/image-host.c b/tools/image-host.c
index 4a24dee8..453cd38f 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1029,10 +1029,13 @@ static int fit_config_process_sig(const char *keydir, const char *keyfile,
 				   &region_proplen))
 		return -1;
 
-	if (fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
+	ret = fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
 				require_keys ? "conf" : NULL, engine_id,
-				algo_name))
+				algo_name);
+	if (ret) {
+		free(info.name);
 		return -1;
+	}
 
 	ret = info.crypto->sign(&info, region, region_count, &value,
 				&value_len);
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] scripts: Fix potential null-deref
@ 2025-04-18  8:19 ant.v.moryakov
  2025-04-18  8:19 ` [PATCH] tools: image-host: Fix potential memory leak ant.v.moryakov
  0 siblings, 1 reply; 5+ messages in thread
From: ant.v.moryakov @ 2025-04-18  8:19 UTC (permalink / raw)
  To: u-boot; +Cc: Maks Mishin

From: Maks Mishin <maks.mishinFZ@gmail.com>

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
---
 scripts/kconfig/menu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 5c5c1374..a0d0d2af 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -812,8 +812,10 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym,
 			}
 		}
 	}
-	for_all_prompts(sym, prop)
-		get_prompt_str(r, prop, head);
+	if (sym) {
+		for_all_prompts(sym, prop)
+			get_prompt_str(r, prop, head);
+	}
 
 	prop = get_symbol_prop(sym);
 	if (prop) {
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-18 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18  8:32 [PATCH] tools: image-host: Fix potential memory leak ant.v.moryakov
  -- strict thread matches above, loose matches on Subject: below --
2025-04-18  8:30 ant.v.moryakov
2025-04-18 13:52 ` Quentin Schulz
2025-04-18  8:19 [PATCH] scripts: Fix potential null-deref ant.v.moryakov
2025-04-18  8:19 ` [PATCH] tools: image-host: Fix potential memory leak ant.v.moryakov
2025-04-18 13:52   ` Quentin Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox