mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
g_strdup the keys that we are passed before adding them to the hash
2006-10-07 Tor Lillqvist <tml@novell.com> * glib/gwin32.c (get_package_directory_from_module) (g_win32_get_package_installation_directory): g_strdup the keys that we are passed before adding them to the hash tables, to guard against the caller freeing them. (#355955, Andreas Köhler)
This commit is contained in:
parent
6b21f5f6d7
commit
891fcada5d
@ -1,3 +1,10 @@
|
|||||||
|
2006-10-07 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gwin32.c (get_package_directory_from_module)
|
||||||
|
(g_win32_get_package_installation_directory): g_strdup the keys
|
||||||
|
that we are passed before adding them to the hash tables, to guard
|
||||||
|
against the caller freeing them. (#355955, Andreas Köhler)
|
||||||
|
|
||||||
2006-10-06 Matthias Clasen <mclasen@redhat.com>
|
2006-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gtimer.c: Fix a typo. (#359190)
|
* glib/gtimer.c: Fix a typo. (#359190)
|
||||||
|
@ -1140,7 +1140,7 @@ get_package_directory_from_module (gchar *module_name)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_hash_table_insert (module_dirs, module_name ? module_name : "", fn);
|
g_hash_table_insert (module_dirs, module_name ? g_strdup (module_name) : "", fn);
|
||||||
|
|
||||||
G_UNLOCK (module_dirs);
|
G_UNLOCK (module_dirs);
|
||||||
|
|
||||||
@ -1243,7 +1243,7 @@ g_win32_get_package_installation_directory (gchar *package,
|
|||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
g_hash_table_insert (package_dirs, package, result);
|
g_hash_table_insert (package_dirs, g_strdup (package), result);
|
||||||
G_UNLOCK (package_dirs);
|
G_UNLOCK (package_dirs);
|
||||||
return g_strdup (result);
|
return g_strdup (result);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user