[glib] gcontenttype: Duplicate the string inside Mutex lock for thread-safety
- From: Akira Tagoh <tagoh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gcontenttype: Duplicate the string inside Mutex lock for thread-safety
- Date: Fri, 25 Jan 2013 04:54:06 +0000 (UTC)
commit 7261294ec163234e52f0edeb24df0b18f5e77395
Author: Akira TAGOH <akira tagoh org>
Date: Thu Jan 24 12:33:39 2013 +0900
gcontenttype: Duplicate the string inside Mutex lock for thread-safety
https://bugzilla.gnome.org/show_bug.cgi?id=692360
gio/gcontenttype.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c
index 6cc805c..5d49b7e 100644
--- a/gio/gcontenttype.c
+++ b/gio/gcontenttype.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]