summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/binfmt_unloadmodule.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-12 18:31:32 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-12 18:31:32 -0600
commit12c4a9fe2ca2a1483c87f4c0bf9cb362580e9421 (patch)
treedbe1fd377b0bc1e15cad76ab6249b9de408cc8b0 /nuttx/binfmt/binfmt_unloadmodule.c
parentdadf6c080c22acc418abea5dc7f55fcc2df16d92 (diff)
downloadnuttx-12c4a9fe2ca2a1483c87f4c0bf9cb362580e9421.tar.gz
nuttx-12c4a9fe2ca2a1483c87f4c0bf9cb362580e9421.tar.bz2
nuttx-12c4a9fe2ca2a1483c87f4c0bf9cb362580e9421.zip
Binfmt no longer depends on a fixed sized argv[] list
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