diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-01-02 16:52:49 +0000 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-01-02 16:52:49 +0000 |
commit | 71f83660f99a20e2b6fcb4c4aa9747c207e2934a (patch) | |
tree | 98b36c602c2953a3332f59290abd0b399c28d12e /tests | |
parent | 6654fa9f02b08f80c1f7d222c4e5871e1e2255bd (diff) | |
download | libcg-71f83660f99a20e2b6fcb4c4aa9747c207e2934a.tar.gz libcg-71f83660f99a20e2b6fcb4c4aa9747c207e2934a.tar.xz libcg-71f83660f99a20e2b6fcb4c4aa9747c207e2934a.zip |
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 <dhaval@linux.vnet.ibm.com>
Cc: Sudhir Kumar <skumar@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@297 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libcgrouptest01.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |