]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: fix wrong malloc size in testcase
authorDhaval Giani <dhaval@linux.vnet.ibm.com>
Fri, 4 Jul 2008 18:47:59 +0000 (18:47 +0000)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Fri, 4 Jul 2008 18:47:59 +0000 (18:47 +0000)
From: Sudhir Kumar <skumar@linux.vnet.ibm.com>

This patch fixes a small mistake in the previous patch for malloc size.
Of course the size should not be of the pointer but the structure.

Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@98 4f4bb910-9a46-0410-90c8-c897d4f1cd53

tests/libcgrouptest01.c

index e144e6c66e6a7ede2369019cfcf332de3672bd6c..72329944a993f8c7c43f8dfc1bea495b2d263f0a 100644 (file)
@@ -593,7 +593,7 @@ int check_fsmounted()
        char entry_buffer[FILENAME_MAX * 4];
        FILE *proc_file;
 
-       tmp_entry = (struct mntent *) malloc(sizeof(struct mntent *));
+       tmp_entry = (struct mntent *) malloc(sizeof(struct mntent));
        if (!tmp_entry) {
                perror("Error: failled to mallloc for mntent\n");
                return 1;