mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-21 14:42:20 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user