From 71f83660f99a20e2b6fcb4c4aa9747c207e2934a Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Fri, 2 Jan 2009 16:52:49 +0000 Subject: libcgrouptest: Initialize uninitialized pointers in test cases Pointers should be initialized to NULL. In the multi mount test case path, we had an uninitialized cgroup_filled which caused a segmentation fault. Fix it for this test case. TODO: Fix for all test cases. Signed-off-by: Dhaval Giani Cc: Sudhir Kumar Acked-by: Balbir Singh git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@297 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/libcgrouptest01.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index 31addfb..a09a389 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -1321,8 +1321,8 @@ void test_cgroup_compare_cgroup(int ctl1, int ctl2, int i) void test_cgroup_get_cgroup(int ctl1, int ctl2, int i) { - struct cgroup *cgroup_filled, *cgroup_a, *cgroup_b; - struct cgroup_controller *controller; + struct cgroup *cgroup_filled = NULL, *cgroup_a = NULL, *cgroup_b = NULL; + struct cgroup_controller *controller = NULL; char controller_name[FILENAME_MAX], control_file[FILENAME_MAX]; int ret; -- cgit