Checking pointer to pointer is not null <p>*A few things to be noted in the code: cfield<b>p</b> is a pointer and cfield<b>pp</b> is a pointer to pointer.</p> <p>I want to know the uses of the new macro (see the code below). We are passing the address of <code>cfieldp</code>,<code>(&amp;cfieldp)</code> instead of <code>cfieldp</code> and comparing it to null. What is its use? Does it stop a memory leak?</p> <pre><code>// Custom data type: typedef struct custom_field { int test; } custom_field_t; // Old macro: #define CUSTOM_CLEAN(cfieldp) \ { \ ..... // Calls free() to free memory \ } // New macro: #define CUSTOM_CLEAN_NEW(cfieldpp) \ { \ if ((cfieldpp)) { \ CUSTOM_CLEAN(*(cfieldpp)) \ } \ } // Code: custom_field_t *cfieldp = NULL; ......// *cfieldp may or may not be null ...... CUSTOM_CLEAN(cfieldp); // Old macro //CUSTOM_CLEAN or CUSTOM_CLEAN_NEW will be executed, not both. CUSTOM_CLEAN_NEW(&amp;cfieldp); // New macro, replacement of CUSTOM_CLEAN </code></pre>