gcontenttype: Duplicate the string inside Mutex lock for thread-safety

https://bugzilla.gnome.org/show_bug.cgi?id=692360
This commit is contained in:
Akira TAGOH 2013-01-24 12:33:39 +09:00
parent c67a2ebda3
commit 7261294ec1

View File

@ -666,8 +666,9 @@ g_content_type_guess (const gchar *filename,
/* Got an extension match, and no conflicts. This is it. */
if (n_name_mimetypes == 1)
{
gchar *s = g_strdup (name_mimetypes[0]);
G_UNLOCK (gio_xdgmime);
return g_strdup (name_mimetypes[0]);
return s;
}
if (data)