title: Calling a function makes UThash to fail
body: <p>I am using the hash-table implementation UThash. </p>
  
  <p>I am inserting elements using the primitive:</p>
  
  <pre><code>    HASH_ADD(hh,hash_table,key,keylen,elem);
  </code></pre>
  
  <p>And retrieving elements with the primitive:</p>
  
  <pre><code>    HASH_FIND(hh,hash_table,key,keylen,elem);
  </code></pre>
  
  <p>For some reason I don't know, the behaviour of hash find is being modified when I call a function. That is to say, <strong>uthash does not find an element that is present in the table</strong>. </p>
  
  <p>I suspect memory has been compromised in some way.</p>
  
  <p>The function that triggers this failure <strong>does not need to execute any code</strong> to make UThash fail:</p>
  
  <pre><code>    //Note: ct = custom_type
      int func1(ct1 *ptr1, ct2 *ptr2, ct3 *ptr3,char **buffer,size_t *size)
      {
         HASH_FIND(...) //does not work
  
         /**
          * code
          */
          return 0;
      }
  
      int func2(ct1 *ptr1,ct2 *ptr2,ct3 *ptr3)
      {
          char *buffer;
          size_t buf_size;
  
         /**
          * code
          */
  
          HASH_FIND(...) // works!
          if(func1(ptr1,ptr2,ptr3,&amp;buffer,&amp;buf_size)){
              //code
          }/*error*/
  
          return 0;
      }
  
      int func3(ct1 *ptr1,ct2 *ptr2,ct3 *ptr3)
      {
          char *buffer;
          size_t buf_size;
  
          HASH_FIND(...) // works!
          if(func1(ptr1,ptr2,ptr3,&amp;buffer,&amp;buf_size)){
              //code
          }/*error*/
  
          /**
           * code
           */
  
          return 0;
      }
  </code></pre>
  
  <p>So in both <em>func2()</em> and <em>func3()</em> the same behaviour happens. hash_find() starts to fail after I call  <em>func1()</em>.</p>
  
  <p><em>All the rest of the code is executed perfectly and correctly.</em> </p>
  
  <p><strong>My obvious question is what could cause such type of failure?</strong></p>
  
  <p>Thank you for reading and be free to ask any additional info.</p>