From 3a8cfb6c04012994130a30b4d11a0eca70887814 Mon Sep 17 00:00:00 2001 From: Nobutaka Toyoshima Date: Mon, 8 Sep 2014 17:48:37 +0900 Subject: [PATCH 1/2] nshlib: Fix a resource leak in cmd_hexdump() Jira: PDFW15IS-265 Coverity-ID: 10786 Signed-off-by: Masayuki Ishikawa --- nshlib/nsh_dbgcmds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nshlib/nsh_dbgcmds.c b/nshlib/nsh_dbgcmds.c index c86d77109..cc67a2708 100644 --- a/nshlib/nsh_dbgcmds.c +++ b/nshlib/nsh_dbgcmds.c @@ -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; } From 9043459c7b24634380da1522f46c28da6ee46811 Mon Sep 17 00:00:00 2001 From: Sebastien Lorquet Date: Mon, 22 May 2017 07:34:13 -0600 Subject: [PATCH 2/2] The dedicated windows tool at APPSDIR/tools/mkkconfig.bat uses , which is not a windows shell variable, and is left uninitialized, but in fact should be the current directory. --- tools/mkkconfig.bat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/mkkconfig.bat b/tools/mkkconfig.bat index cc58b8527..e7865cca2 100755 --- a/tools/mkkconfig.bat +++ b/tools/mkkconfig.bat @@ -75,6 +75,9 @@ REM GOTO :End REM ) ) +REM Get the current directory +SET APPSDIR=%~dp0 + Echo # > %kconfig% Echo # For a description of the syntax of this configuration file, >> %kconfig% Echo # see the file kconfig-language.txt in the NuttX tools repository. >> %kconfig% @@ -89,10 +92,9 @@ IF %menu% NEQ "" ( DIR /B /A:D >_tmp_.dat -Echo source "$APPSDIR/builtin/Kconfig" >> %kconfig% FOR /F "tokens=*" %%s IN (_tmp_.dat) do ( IF EXIST %%s\Kconfig ( - Echo source "$APPSDIR/%%s/Kconfig" >> %kconfig% + Echo source "%APPSDIR%/%%s/Kconfig" >> %kconfig% ) ) DEL _tmp_.dat