From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! commands: devlookup: add support for cdev aliases
Date: Fri, 25 Apr 2025 07:48:39 +0200 [thread overview]
Message-ID: <20250425054839.2059381-1-a.fatoum@pengutronix.de> (raw)
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
reply other threads:[~2025-04-25 5:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250425054839.2059381-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox