diff options
author | Tomasz Moń <desowin@gmail.com> | 2019-08-27 17:49:53 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-08-28 03:51:32 +0000 |
commit | 5f5a934bca72f352f64bc5138c58cbc3dbea8323 (patch) | |
tree | 4afad73042891c78739b662db072ae484173361d /wsutil | |
parent | 05b6a9ad0bc86e2fddb250a7280fcf4658d66b82 (diff) |
Use g_hash_table_replace() when key depends on data
Using g_hash_table_insert() in cases where the key is contained within
value is error prone. Use g_hash_table_replace() to eliminate the risk
of ending up with incoherent hash table state.
Change-Id: I595457476a2682e927d2c56b2692404aef4dc43a
Reviewed-on: https://code.wireshark.org/review/34385
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/plugins.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 1293ce3672..f4fa859b48 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -203,7 +203,7 @@ DIAG_ON_PEDANTIC new_plug->type_name = type_to_name(type); /* Add it to the list of plugins. */ - g_hash_table_insert(plugins_module, new_plug->name, new_plug); + g_hash_table_replace(plugins_module, new_plug->name, new_plug); } ws_dir_close(dir); g_free(plugin_folder); |