mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
Fix a memory leak in g_strerror
If g_locale_to_utf8 sets a GError, it must be freed.
This commit is contained in:
parent
6c22a5ee2b
commit
774d8bd914
@ -1369,7 +1369,10 @@ g_strerror (gint errnum)
|
||||
{
|
||||
msg = g_locale_to_utf8 (msg, -1, NULL, NULL, &error);
|
||||
if (error)
|
||||
g_print ("%s\n", error->message);
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
else if (msg == (const gchar *)buf)
|
||||
msg = g_strdup (buf);
|
||||
|
Loading…
Reference in New Issue
Block a user