mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +01:00
gtimezone: Fix two minor leaks in zone_info_unix()
• A leak of filename on an error path
• A leak of resolved_identifier if no out_identifier return location
was provided
The latter was spotted by Peter Bloomfield
(8945227743 (note_111254)
).
Thanks!
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
This commit is contained in:
parent
a9fe62aa2c
commit
12de474808
@ -457,9 +457,8 @@ zone_info_unix (const gchar *identifier,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Error */
|
/* Error */
|
||||||
if (out_identifier != NULL)
|
g_assert (resolved_identifier == NULL);
|
||||||
*out_identifier = NULL;
|
goto out;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -494,12 +493,16 @@ zone_info_unix (const gchar *identifier,
|
|||||||
g_mapped_file_ref (file));
|
g_mapped_file_ref (file));
|
||||||
g_mapped_file_unref (file);
|
g_mapped_file_unref (file);
|
||||||
}
|
}
|
||||||
g_free (filename);
|
|
||||||
|
|
||||||
g_assert (resolved_identifier != NULL);
|
g_assert (resolved_identifier != NULL);
|
||||||
|
|
||||||
|
out:
|
||||||
if (out_identifier != NULL)
|
if (out_identifier != NULL)
|
||||||
*out_identifier = g_steal_pointer (&resolved_identifier);
|
*out_identifier = g_steal_pointer (&resolved_identifier);
|
||||||
|
|
||||||
|
g_free (resolved_identifier);
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
return zoneinfo;
|
return zoneinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user