From: Dhaval Giani Date: Fri, 4 Jul 2008 18:47:59 +0000 (+0000) Subject: libcgroup: fix wrong malloc size in testcase X-Git-Tag: v0.34~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ebbb7f97eafabcb124f43e8fa59265e5bf3a509;p=thirdparty%2Flibcgroup.git libcgroup: fix wrong malloc size in testcase From: Sudhir Kumar 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 Signed-off-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@98 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index e144e6c6..72329944 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -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;