Assign null to the address of a pointer
<p>How can I deinitialize x inside the free_x function? I have to do it in order to fit to an API method. I can very easily deinitialize x just by assigning null to it but I have to do it inside the free_x function.</p>

<pre><code>typedef struct
{
    int field1;
    void *field2;
}my_struct;

static my_struct var;

int main(void)
{
    void *x;

    alloc_x(&amp;x);
    free_x(x); // x = NULL works but not allowed

    return 0;
}

void alloc_x(void **param)
{
    *param = (my_struct *)&amp;var;
}

void free_x(void *param)
{
    // how can I free param here?
}
</code></pre>