diff options
author | Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> | 2016-02-24 08:59:07 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-02-24 11:56:43 +0000 |
commit | 7c15566fa1a92c2970cfd00331efad9b08c50241 (patch) | |
tree | 6dcef680d9ce9360c7e498e9157e451cb96b9ce7 /epan/dissectors | |
parent | f897899f6137cc471b3236719b96507471d58884 (diff) |
packet-nfs: do not call g_hash_table_remove before g_hash_table_insert
The g_hash_table_insert will remove and deallocate existing entry, so we
don't need to do it at all.
Change-Id: I661cadd8beea9585885e48c03a8b52561d1df778
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Reviewed-on: https://code.wireshark.org/review/14113
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-nfs.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 384f6fd3ba..cdd337d390 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -1120,7 +1120,7 @@ static void nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length) { unsigned char *fh; - nfs_name_snoop_t *nns, *old_nns; + nfs_name_snoop_t *nns; nfs_name_snoop_key_t *key; /* find which request we correspond to */ @@ -1145,13 +1145,6 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length) key->fh_length = nns->fh_length; key->fh = nns->fh; - /* already have something matched for this fh, remove it from - the table */ - old_nns = (nfs_name_snoop_t *)g_hash_table_lookup(nfs_name_snoop_matched, key); - if (old_nns) { - g_hash_table_remove(nfs_name_snoop_matched, key); - } - g_hash_table_steal(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid)); g_hash_table_insert(nfs_name_snoop_matched, key, nns); } |