From 2bfe2c2ed01cd74b7239dd3eea7f5501430e8c99 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sat, 12 Oct 2024 16:37:17 +0800 Subject: [PATCH] nshlib: Fix a typo error of redirect Signed-off-by: wangjianyu3 --- nshlib/nsh_parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 2c716946ff4..c2ccb2a21de 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -2855,10 +2855,12 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) vtbl->np.np_redir_out = redirect_out_save; } + /* Free the redirected input file path */ + if (redirfile_in) { nsh_freefullpath(redirfile_in); - vtbl->np.np_redir_out = redirect_in_save; + vtbl->np.np_redir_in = redirect_in_save; } dynlist_free: