Ticket #4357: code clean up before 4.8.29 release.

(vfs_s_open): minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-06-07 22:03:53 +03:00
parent e48cd98ac1
commit 52fd6215b0

View File

@ -1327,15 +1327,12 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
return NULL;
dirname = g_path_get_dirname (q);
name = g_path_get_basename (q);
dir = vfs_s_find_inode (path_element->class, super, dirname, LINK_FOLLOW, FL_DIR);
g_free (dirname);
if (dir == NULL)
{
g_free (dirname);
g_free (name);
return NULL;
}
name = g_path_get_basename (q);
ent = vfs_s_generate_entry (path_element->class, name, dir, 0755);
ino = ent->ino;
vfs_s_insert_entry (path_element->class, dir, ent);
@ -1348,14 +1345,13 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
ino->localname = vfs_path_free (tmp_vpath, FALSE);
if (tmp_handle == -1)
{
g_free (dirname);
g_free (name);
return NULL;
}
close (tmp_handle);
}
g_free (dirname);
g_free (name);
was_changed = TRUE;
}