The memory allocated within a function should be released before the function return,otherwise memleak will occur.
Signed-off-by: zhujun2 zhujun2@cmss.chinamobile.com --- tools/testing/selftests/memfd/fuse_test.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing/selftests/memfd/fuse_test.c index 93798c8c5d54..fd934487c528 100644 --- a/tools/testing/selftests/memfd/fuse_test.c +++ b/tools/testing/selftests/memfd/fuse_test.c @@ -217,6 +217,7 @@ static pid_t spawn_sealing_thread(void) abort(); }
+ free(stack); return pid; }