[LTP] [PATCH] lib/tst_test.c: fix Segmentation fault in tst_vbrk_

Xiao Yang yangx.jy@cn.fujitsu.com
Thu Jun 16 09:52:04 CEST 2016


We can't allocate resources to results pointer before checking
kernel version, so do_exit() will fail if we print results pointer.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index c560727..68791cb 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -237,7 +237,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
 		do_test_cleanup();
 
 	if (getpid() == lib_pid)
-		do_exit(TTYPE_RESULT(ttype));
+		do_cleanup();
 
 	exit(TTYPE_RESULT(ttype));
 }
-- 
1.8.3.1





More information about the ltp mailing list