Correct a memory leak in NSH

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5600 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-02-02 23:56:54 +00:00
parent cca7618daa
commit 7f474703fa
2 changed files with 36 additions and 10 deletions

View File

@@ -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);
}