Hi,

At the beginning of main() I have :-
Code:
int main()
{
   record tempRecord;
   record * theRecords = NULL;
   record * newRecord = &tempRecord;
At the end of main() I have :-
Code:
   /* Free up allocated memory */
   newRecord = NULL;
   free(theRecords);
   theRecords = NULL;
   return 0;
}  /* end main() */
By setting newRecord to NULL, and given that the fields of newRecord at this point still contain data for the last record added, have I just created a memory leak ? If so, do I have to clear the fields of newRecord before setting it to NULL or is that a moot point at this point in main() ?

Stuart