summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/strategy.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-12-13 21:24:19 +0000
committerGerrit Code Review <gerrit@fd.io>2019-12-13 21:24:19 +0000
commitd4aab68ff7a309b0cf500ff947dbbbf83ab0ab03 (patch)
treef8eba0aa1a8a4643323a3a77d9e278edadbd341a /hicn-plugin/src/strategy.c
parent5beae2545c8006c984003374e8de04532a7d5c03 (diff)
parent2cf6ae9b832f3709209a63778e85ca46d3e1a1ec (diff)
Merge "[HICN-457] Adding missing lock to the hash entry in order to avoid memory leak."
Diffstat (limited to 'hicn-plugin/src/strategy.c')
-rw-r--r--hicn-plugin/src/strategy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hicn-plugin/src/strategy.c b/hicn-plugin/src/strategy.c
index 62c2ddc8b..15c0dc720 100644
--- a/hicn-plugin/src/strategy.c
+++ b/hicn-plugin/src/strategy.c
@@ -117,6 +117,9 @@ hicn_new_interest (hicn_strategy_runtime_t * rt, vlib_buffer_t * b0,
hicn_store_internal_state (b0, hicnb0->name_hash, node_id0,
dpo_ctx_id0, vft_id0, hash_entry_id,
bucket_id, bucket_is_overflow);
+ // We need to take a lock as the lock is not taken on the hash
+ // entry because it is a CS entry (hash_insert function).
+ hash_entry->locks++;
*next =
is_cs0 ? HICN_STRATEGY_NEXT_INTEREST_HITCS :
HICN_STRATEGY_NEXT_INTEREST_HITPIT;