It&#x27;s just a minimal example.<p>&gt; Its primary merit is that it makes use-after-free cases immediately obvious, since they&#x27;re going to trigger a segfault.<p>But then it hides double free errors.<p><pre><code>    int count = 0;

    void foo_destroy(struct foo **f) { free(*f); count--; *f = NULL; }

    void bar() {
        struct foo *f = malloc(sizeof(struct foo));

        foo_destroy(&amp;f); &#x2F;&#x2F; ok
        foo_destroy(&amp;f); &#x2F;&#x2F; no error, but count is now wrong
    }</code></pre>