title: How to assert that memory is freed
body: <p>I have a function in which there is a free of memory.</p>
  
  <p>and I want after calling this function assert that the function has freed the given memory.</p>
  
  <p>And I could not change any thing in this function.</p>
  
  <p>I need that for uni tests. I want to test my function, I want to check that my function really free the memory after calling it</p>
  
  <p>The question is in the code</p>
  
  <pre><code>void func(char *mem)
  {
    // Some where in the function there is a free of the memory
    // The free could be into if condition so there is a risk to not be executed
  }
  
  int main()
  {
     char *mem = malloc(20);
     func(mem);
     // how to assert here that the memory is freed?
  }
  </code></pre>