mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! commands: devlookup: add support for cdev aliases
@ 2025-04-25  5:48 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-04-25  5:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

commands: devlookup: fix memory leak in error case

There's a string_list_free after out:, which we are skipping when we
directly return.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/devlookup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commands/devlookup.c b/commands/devlookup.c
index 5877d5f1b82c..b7fd7be3b624 100644
--- a/commands/devlookup.c
+++ b/commands/devlookup.c
@@ -59,7 +59,8 @@ static int do_devlookup(int argc, char *argv[])
 		aliasbuf = string_list_join(&sl, " ");
 		if (string_list_count(&sl) > 1 && (kernelopt || paramname)) {
 			printf("Option not supported for multi cdev alias\n");
-			return COMMAND_ERROR;
+			ret = COMMAND_ERROR;
+			goto out;
 		}
 
 		if (alias) {
-- 
2.39.5




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-25  5:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-25  5:48 [PATCH] fixup! commands: devlookup: add support for cdev aliases Ahmad Fatoum

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