title: How to check value of a pointer in C
body: <p>I am coding a program where a pointer <code>STR *pt</code> to a <code>STR</code> type structure that I am using (basically an array of <code>STR</code> structures with which I want to use dynamic memory) might takes a <code>NULL</code> value as sometimes I don't want to store any array trough it, so when I use <code>free(pt)</code> over that pointer I get a segmentation fault. What I want is to check it that pointer has a <code>NULL</code> value, but when I check <code>if(pt != NULL) free(pt);</code> (I only want to free memory when pointer is not <code>NULL</code>), condition is always true, pointer is tryed to be freed and segmentation fault happens.</p>
  <p>Is there any way to solve this problem?
  Another way to compare pointer values?</p>