Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target linux: bug in heap_caps_realloc_base (IDFGH-10261) #11523

Closed
3 tasks done
espradio opened this issue May 28, 2023 · 2 comments
Closed
3 tasks done

target linux: bug in heap_caps_realloc_base (IDFGH-10261) #11523

espradio opened this issue May 28, 2023 · 2 comments
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@espradio
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

realloc is expecting the size not caps. Diff for the same.

diff --git a/components/heap/heap_caps_linux.c b/components/heap/heap_caps_linux.c
index 981f861674..67746132de 100644
--- a/components/heap/heap_caps_linux.c
+++ b/components/heap/heap_caps_linux.c
@@ -80,7 +80,7 @@ void *heap_caps_malloc_prefer( size_t size, size_t num, ... )

 static void *heap_caps_realloc_base( void *ptr, size_t size, uint32_t caps)
 {
-    ptr = realloc(ptr, caps);
+    ptr = realloc(ptr, size);

     if (ptr == NULL && size > 0) {
         heap_caps_alloc_failed(size, caps, __func__);
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 28, 2023
@github-actions github-actions bot changed the title target linux: bug in heap_caps_realloc_base target linux: bug in heap_caps_realloc_base (IDFGH-10261) May 28, 2023
@ESP-Marius
Copy link
Collaborator

Ah, you are right. Thanks for reporting this.

We'll fix it.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels May 30, 2023
@0xjakob
Copy link
Contributor

0xjakob commented May 31, 2023

@espradio The fix has been merged internally and will synchronize to github soon.

espressif-bot pushed a commit that referenced this issue Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants