From bed10d9288e1c61599580049d63fe74873c08b37 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 2 Feb 2013 23:56:54 +0000 Subject: Correct a memory leak in NSH git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5600 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_parse.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/nshlib/nsh_parse.c') diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index f679d9b32..26b41e89b 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -1424,6 +1424,13 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline) * successfully). So certainly it is not an NSH command. */ + /* Free the redirected output file path */ + + nsh_freefullpath(redirfile); + redirfile = NULL; + + /* Save the result: success if 0; failure if 1 */ + return nsh_saveresult(vtbl, ret != OK); } @@ -1458,6 +1465,13 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline) * successfully). So certainly it is not an NSH command. */ + /* Free the redirected output file path */ + + nsh_freefullpath(redirfile); + redirfile = NULL; + + /* Save the result: success if 0; failure if 1 */ + return nsh_saveresult(vtbl, ret != OK); } -- cgit v1.2.3