From 8c193999f747619d650219493dcdba72a65b3f44 Mon Sep 17 00:00:00 2001 From: Carl Fredrik Hammar Date: Thu, 3 Jun 2010 22:50:32 +0200 Subject: Fix malloc size in tmpfs * tmpfs/dir.c (diskfs_direnter_hard): Fix malloc size. --- tmpfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmpfs') diff --git a/tmpfs/dir.c b/tmpfs/dir.c index 25b99bd8..2702da54 100644 --- a/tmpfs/dir.c +++ b/tmpfs/dir.c @@ -247,7 +247,7 @@ diskfs_direnter_hard (struct node *dp, const char *name, > tmpfs_page_limit) return ENOSPC; - new = malloc (entsize); + new = malloc (offsetof (struct tmpfs_dirent, name) + namelen + 1); if (new == 0) return ENOSPC; -- cgit v1.2.3