<p>In <a href="https://github.com/kamailio/kamailio/pull/390#discussion_r44547806">modules/rtpengine/rtpengine_hash.c</a>:</p>
<pre style='color:#555'>> +}
> +
> +int rtpengine_hash_table_insert(void *key, void *value) {
> +  struct rtpengine_hash_entry *entry, *last_entry;
> +  struct rtpengine_hash_entry *new_entry = (struct rtpengine_hash_entry *) value;
> +  unsigned int hash_index;
> +
> +  // check rtpengine hashtable
> +  if (!rtpengine_hash_table) {
> +          LM_ERR("NULL rtpengine_hash_table");
> +          return 0;
> +  }
> +
> +  // get entry list
> +  hash_index = str_hash(key);
> +  entry = rtpengine_hash_table->entry_list[hash_index];
</pre>
<p>Don't you need to acquire the lock before accessing the start element for the list?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/390/files#r44547806">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVDDXwN9qh5BrzqoEAUdzfaK4fABks5pE1xngaJpZM4GcraR.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/390/files#r44547806"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>