hush: avoid NULL check before free()
PATCH 1/1 hush: avoid NULL check before free()
free() checks if its argument is NULL. Don't duplicate this in the calling code.
Signed-off-by Heinrich Schuchardt <[email protected]>
--- common/cli_hush.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
common/cli_hush.c +1 -2
@@ -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
PATCH 1/1 hush: avoid NULL check before free()
Quoted 9 lines · Heinrich Schuchardt
free()checks if its argument is NULL. Don't duplicate this in the calling code.Signed-off-by Heinrich Schuchardt <[email protected]>--- common/cli_hush.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 hush: avoid NULL check before free()
In reply to Heinrich SchuchardtQuoted 5 lines · Heinrich Schuchardt
free()checks if its argument is NULL. Don't duplicate this in the calling code.Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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>