diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-07-28 20:24:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-07-28 20:24:27 +0000 |
commit | e65c5cc89e6e65a16decde7019cf4c12a8d2a95a (patch) | |
tree | b81933bab5b9b954a066307fb2e3e97fb3be4452 /ui/recent.c | |
parent | dbabc55955d9fcf915f2fcf33b9c963b9561fe9a (diff) |
Add a comment.
In recent_add_cfilter(), the list we're working on is cfilter_list;
properly remove an item from it - don't assign the result to
recent_cfilter_list, assign it to cfilter_list. This may fix some
crashes and Valgrind errors.
svn path=/trunk/; revision=50984
Diffstat (limited to 'ui/recent.c')
-rw-r--r-- | ui/recent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/recent.c b/ui/recent.c index e5a14fcaad..5568d136bb 100644 --- a/ui/recent.c +++ b/ui/recent.c @@ -333,6 +333,8 @@ recent_add_cfilter(const gchar *ifname, const gchar *s) if (ifname == NULL) cfilter_list = recent_cfilter_list; else { + /* If we don't yet have a hash table for per-interface recent + capture filter lists, create one. */ if (per_interface_cfilter_lists_hash == NULL) per_interface_cfilter_lists_hash = g_hash_table_new(g_str_hash, g_str_equal); cfilter_list = (GList *)g_hash_table_lookup(per_interface_cfilter_lists_hash, ifname); @@ -346,7 +348,7 @@ recent_add_cfilter(const gchar *ifname, const gchar *s) if (strcmp(s, li_filter) == 0) { /* No need to copy the string, we're just moving it. */ newfilter = li_filter; - recent_cfilter_list = g_list_remove(cfilter_list, li->data); + cfilter_list = g_list_remove(cfilter_list, li->data); break; } li = li->next; |