Free curr->rmstack instead of double free of curr->stack. Signed-off-by: Sebastian Herbszt <herbszt at gmx.de> diff --git a/core/thread/exit_thread.c b/core/thread/exit_thread.c index 4da224b..f598624 100644 --- a/core/thread/exit_thread.c +++ b/core/thread/exit_thread.c @@ -16,7 +16,7 @@ __noreturn __exit_thread(void) /* Free allocated stacks (note: free(NULL) is permitted and safe). */ free(curr->stack); - free(curr->stack); + free(curr->rmstack); /* * Note: __schedule() can explictly handle the case where