mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 18:26:19 +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
|
||||
{
|
||||
/* Error */
|
||||
if (out_identifier != NULL)
|
||||
*out_identifier = NULL;
|
||||
return NULL;
|
||||
g_assert (resolved_identifier == NULL);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -494,12 +493,16 @@ zone_info_unix (const gchar *identifier,
|
||||
g_mapped_file_ref (file));
|
||||
g_mapped_file_unref (file);
|
||||
}
|
||||
g_free (filename);
|
||||
|
||||
g_assert (resolved_identifier != NULL);
|
||||
|
||||
out:
|
||||
if (out_identifier != NULL)
|
||||
*out_identifier = g_steal_pointer (&resolved_identifier);
|
||||
|
||||
g_free (resolved_identifier);
|
||||
g_free (filename);
|
||||
|
||||
return zoneinfo;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user