diff options
Diffstat (limited to 'src/vppinfra')
-rw-r--r-- | src/vppinfra/hash.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vppinfra/hash.h b/src/vppinfra/hash.h index 6206dd2a486..21986ea774c 100644 --- a/src/vppinfra/hash.h +++ b/src/vppinfra/hash.h @@ -294,10 +294,12 @@ always_inline void hash_unset_mem_free (uword ** h, void *key) { hash_pair_t *hp = hash_get_pair_mem (*h, key); - ASSERT (hp); - key = uword_to_pointer (hp->key, void *); - hash_unset_mem (*h, key); - clib_mem_free (key); + if (PREDICT_TRUE (hp != NULL)) + { + key = uword_to_pointer (hp->key, void *); + hash_unset_mem (*h, key); + clib_mem_free (key); + } } /* internal routine to free a hash table */ |