From bf5834227588cc76a41d750821cbff8d594ec771 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 19 Oct 2005 15:38:44 +0000 Subject: [PATCH] Return a g_strdup()ed copy of the value stored in the hash table, so that 2005-10-19 Tor Lillqvist * glib/gwin32.c (g_win32_get_package_installation_directory): Return a g_strdup()ed copy of the value stored in the hash table, so that it can be g_free()d without leaving a dangling pointer in the hash table. (#319232) --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ glib/gwin32.c | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a459357..e2f047e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-19 Tor Lillqvist + + * glib/gwin32.c (g_win32_get_package_installation_directory): + Return a g_strdup()ed copy of the value stored in the hash table, + so that it can be g_free()d without leaving a dangling pointer in + the hash table. (#319232) + 2005-10-06 Matthias Clasen * glib/gunicollate.c (g_utf8_collate_key_for_filename): Handle diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a459357..e2f047e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2005-10-19 Tor Lillqvist + + * glib/gwin32.c (g_win32_get_package_installation_directory): + Return a g_strdup()ed copy of the value stored in the hash table, + so that it can be g_free()d without leaving a dangling pointer in + the hash table. (#319232) + 2005-10-06 Matthias Clasen * glib/gunicollate.c (g_utf8_collate_key_for_filename): Handle diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index a459357..e2f047e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +2005-10-19 Tor Lillqvist + + * glib/gwin32.c (g_win32_get_package_installation_directory): + Return a g_strdup()ed copy of the value stored in the hash table, + so that it can be g_free()d without leaving a dangling pointer in + the hash table. (#319232) + 2005-10-06 Matthias Clasen * glib/gunicollate.c (g_utf8_collate_key_for_filename): Handle diff --git a/glib/gwin32.c b/glib/gwin32.c index 4e9bfc4..57d57ca 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -1318,7 +1318,7 @@ g_win32_get_package_installation_directory (gchar *package, { g_hash_table_insert (package_dirs, package, result); G_UNLOCK (package_dirs); - return result; + return g_strdup (result); } G_UNLOCK (package_dirs); } -- 2.7.4