On 2023-11-15 00:45, zhujun2 wrote:
The memory allocated within a function should be released before the function return,otherwise memleak will occur.
[...]
--- a/tools/testing/selftests/memfd/fuse_test.c +++ b/tools/testing/selftests/memfd/fuse_test.c @@ -205,6 +205,7 @@ static pid_t spawn_sealing_thread(void) stack = malloc(STACK_SIZE); if (!stack) { printf("malloc(STACK_SIZE) failed: %m\n");
abort();free(stack);
Freeing process memory immediately before an abort(3) seems rather pointless, because the whole process is going away anyway. It's like tidying up your house right before it is scheduled to be bulldozed away to make room for a new highway. :-)
Thanks,
Mathieu