summaryrefslogtreecommitdiff
path: root/ui/recent.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-07-28 22:37:45 +0000
committerGuy Harris <guy@alum.mit.edu>2013-07-28 22:37:45 +0000
commit21ba3c2352ebdf1021fbe0f8ee5e45ec11e7dfb4 (patch)
treebdd227ec96fc88bf1b229daa6915d5fd089f8781 /ui/recent.c
parentf3fb2c00ec7db47603c80ea2ef67161de44ce230 (diff)
downloadwireshark-21ba3c2352ebdf1021fbe0f8ee5e45ec11e7dfb4.tar.gz
Close a memory leak.
svn path=/trunk/; revision=50993
Diffstat (limited to 'ui/recent.c')
-rw-r--r--ui/recent.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/recent.c b/ui/recent.c
index 5568d136bb..41f5f93263 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -334,9 +334,10 @@ recent_add_cfilter(const gchar *ifname, const gchar *s)
cfilter_list = recent_cfilter_list;
else {
/* If we don't yet have a hash table for per-interface recent
- capture filter lists, create one. */
+ capture filter lists, create one. Have it free the new key
+ if we're updating an entry rather than creating it below. */
if (per_interface_cfilter_lists_hash == NULL)
- per_interface_cfilter_lists_hash = g_hash_table_new(g_str_hash, g_str_equal);
+ per_interface_cfilter_lists_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
cfilter_list = (GList *)g_hash_table_lookup(per_interface_cfilter_lists_hash, ifname);
}