* [PATCH 1/1] hush: avoid NULL check before free()
@ 2020-04-28 19:56 Heinrich Schuchardt
2020-04-28 22:40 ` Simon Glass
2020-05-01 21:57 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-04-28 19:56 UTC (permalink / raw)
To: u-boot
free() checks if its argument is NULL. Don't duplicate this in the calling
code.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
common/cli_hush.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/common/cli_hush.c b/common/cli_hush.c
index cf1e273485..a62af07cc5 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -1849,8 +1849,7 @@ static int run_list_real(struct pipe *pi)
continue;
} else {
/* insert new value from list for variable */
- if (pi->progs->argv[0])
- free(pi->progs->argv[0]);
+ free(pi->progs->argv[0]);
pi->progs->argv[0] = *list++;
#ifndef __U_BOOT__
pi->progs->glob_result.gl_pathv[0] =
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] hush: avoid NULL check before free()
2020-04-28 19:56 [PATCH 1/1] hush: avoid NULL check before free() Heinrich Schuchardt
@ 2020-04-28 22:40 ` Simon Glass
2020-05-01 21:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-04-28 22:40 UTC (permalink / raw)
To: u-boot
On Tue, 28 Apr 2020 at 13:56, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> free() checks if its argument is NULL. Don't duplicate this in the calling
> code.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> common/cli_hush.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] hush: avoid NULL check before free()
2020-04-28 19:56 [PATCH 1/1] hush: avoid NULL check before free() Heinrich Schuchardt
2020-04-28 22:40 ` Simon Glass
@ 2020-05-01 21:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-05-01 21:57 UTC (permalink / raw)
To: u-boot
On Tue, Apr 28, 2020 at 09:56:10PM +0200, Heinrich Schuchardt wrote:
> free() checks if its argument is NULL. Don't duplicate this in the calling
> code.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200501/e00be0ba/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-01 21:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 19:56 [PATCH 1/1] hush: avoid NULL check before free() Heinrich Schuchardt
2020-04-28 22:40 ` Simon Glass
2020-05-01 21:57 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.