From ec1d29e61c6d83d3d99bf8bd9ff5d2cee96460c1 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sat, 11 Feb 2012 14:42:09 +0100 Subject: fs: Store mtab path in allocated string Signed-off-by: Sascha Hauer --- fs/fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/fs.c b/fs/fs.c index afa0198b6e..d65a41fc6d 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -808,8 +808,8 @@ int mount(const char *device, const char *fsname, const char *_path) dev = &fsdev->dev; /* add mtab entry */ - entry = &fsdev->mtab; - safe_strncpy(entry->path, path, PATH_MAX); + entry = &fsdev->mtab; + entry->path = xstrdup(path); entry->dev = dev; entry->parent_device = parent_device; @@ -860,6 +860,7 @@ int umount(const char *pathname) return errno; } + free(entry->path); list_del(&entry->list); if (entry == mtab_root) mtab_root = NULL; -- cgit v1.2.3