mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
gutils: Fix an unlikely minor leak in g_build_user_data_dir()
A leak can happen if the `data_dir` is the empty string. See https://gitlab.gnome.org/GNOME/glib/-/jobs/3294034 Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
aed9098530
commit
1a979ab494
@ -1883,6 +1883,7 @@ g_build_user_data_dir (void)
|
||||
if (!data_dir || !data_dir[0])
|
||||
{
|
||||
gchar *home_dir = g_build_home_dir ();
|
||||
g_free (data_dir);
|
||||
data_dir = g_build_filename (home_dir, ".local", "share", NULL);
|
||||
g_free (home_dir);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user