summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/binfmt_unloadmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/binfmt/binfmt_unloadmodule.c')
-rw-r--r--nuttx/binfmt/binfmt_unloadmodule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c
index ce1b0e53d..535942b0f 100644
--- a/nuttx/binfmt/binfmt_unloadmodule.c
+++ b/nuttx/binfmt/binfmt_unloadmodule.c
@@ -228,13 +228,19 @@ int unload_module(FAR struct binary_s *binp)
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
void binfmt_freeargv(FAR struct binary_s *binp)
{
+ /* Is there an allocated argument buffer */
+
if (binp->argbuffer)
{
/* Free the argument buffer */
kmm_free(binp->argbuffer);
- binp->argbuffer = NULL;
}
+
+ /* Nullify the allocated argv[] array and the argument buffer pointers */
+
+ binp->argbuffer = (FAR char *)NULL;
+ binp->argv = (FAR char **)NULL;
}
#endif