nshlib: Fix a resource leak in cmd_hexdump()

Jira: PDFW15IS-265
Coverity-ID: 10786
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Nobutaka Toyoshima 2014-09-08 17:48:37 +09:00 committed by Masayuki Ishikawa
parent 1ad991e803
commit 3a8cfb6c04

View File

@ -395,6 +395,7 @@ int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
buffer = (FAR uint8_t *)malloc(IOBUFFERSIZE);
if(buffer == NULL)
{
(void)close(fd);
nsh_output(vtbl, g_fmtcmdfailed, "hexdump", "malloc", NSH_ERRNO);
return ERROR;
}