You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2022/07/20 12:26:36 UTC

[incubator-nuttx] branch revert-6644-fix_memory_leak created (now 9be14a0090)

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a change to branch revert-6644-fix_memory_leak
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


      at 9be14a0090 Revert "binfmt: Fix memory leak in ELF loader"

This branch includes the following new commits:

     new 9be14a0090 Revert "binfmt: Fix memory leak in ELF loader"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-nuttx] 01/01: Revert "binfmt: Fix memory leak in ELF loader"

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch revert-6644-fix_memory_leak
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9be14a00901679cd9e3a32da3114243b48fa260d
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Wed Jul 20 21:26:30 2022 +0900

    Revert "binfmt: Fix memory leak in ELF loader"
    
    This reverts commit 23d57be21b79531f1ecaf4882bae62a8153ede4a.
---
 binfmt/elf.c                  | 5 ++---
 include/nuttx/binfmt/binfmt.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/binfmt/elf.c b/binfmt/elf.c
index ef225ec06e..85fbe300aa 100644
--- a/binfmt/elf.c
+++ b/binfmt/elf.c
@@ -277,10 +277,9 @@ static int elf_loadbinary(FAR struct binary_s *binp,
   up_addrenv_clone(&loadinfo.addrenv, &binp->addrenv);
 #else
   binp->alloc[0]  = (FAR void *)loadinfo.textalloc;
-  binp->alloc[1]  = (FAR void *)loadinfo.dataalloc;
 #ifdef CONFIG_BINFMT_CONSTRUCTORS
-  binp->alloc[2]  = loadinfo.ctoralloc;
-  binp->alloc[3]  = loadinfo.dtoralloc;
+  binp->alloc[1]  = loadinfo.ctoralloc;
+  binp->alloc[2]  = loadinfo.dtoralloc;
 #endif
 #endif
 
diff --git a/include/nuttx/binfmt/binfmt.h b/include/nuttx/binfmt/binfmt.h
index e730551628..8c17d8f53b 100644
--- a/include/nuttx/binfmt/binfmt.h
+++ b/include/nuttx/binfmt/binfmt.h
@@ -39,7 +39,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define BINFMT_NALLOC 4
+#define BINFMT_NALLOC 3
 
 /****************************************************************************
  * Public Types