diff --git a/nshlib/nsh_console.h b/nshlib/nsh_console.h index a03ea664ace..31edf27e689 100644 --- a/nshlib/nsh_console.h +++ b/nshlib/nsh_console.h @@ -71,7 +71,7 @@ * See struct serialsave_s in nsh_console.c */ -#define SAVE_SIZE (2 * sizeof(int)) +#define SAVE_SIZE (3 * sizeof(int)) /* Are we using the NuttX console for I/O? Or some other character device? */ 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: