mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Fix g_strerror() on non-glibc
When using one of the codepaths that copies the error string into buf, make sure the string gets strdup() afterward. https://bugzilla.gnome.org/show_bug.cgi?id=758194
This commit is contained in:
parent
03cb2eb088
commit
f87e002313
@ -1293,6 +1293,8 @@ g_strerror (gint errnum)
|
||||
if (error)
|
||||
g_print ("%s\n", error->message);
|
||||
}
|
||||
else if (msg == (const gchar *)buf)
|
||||
msg = g_strdup (buf);
|
||||
|
||||
g_hash_table_insert (errors, GINT_TO_POINTER (errnum), (char *) msg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user