From 6e8e55ed05885b732a45e2909cb9734576ea7f83 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 3 Jan 2023 09:30:39 +0300 Subject: [PATCH] (vfs_s_open): reuse variable for directory name and file name. Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 0a3df9bd8..a5e04c8fa 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -1318,7 +1318,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) if (ino == NULL) { - char *dirname, *name; + char *name; struct vfs_s_entry *ent; struct vfs_s_inode *dir; @@ -1326,9 +1326,9 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) if ((flags & O_CREAT) == 0 || path_element->class->write == NULL) return NULL; - dirname = g_path_get_dirname (q); - dir = vfs_s_find_inode (path_element->class, super, dirname, LINK_FOLLOW, FL_DIR); - g_free (dirname); + name = g_path_get_dirname (q); + dir = vfs_s_find_inode (path_element->class, super, name, LINK_FOLLOW, FL_DIR); + g_free (name); if (dir == NULL) return NULL;