/* Deallocates or frees a memory block */\r
void free (void *ptr)\r
{\r
- RuntimeFreeMem (ptr);\r
+ //\r
+ // In Standard C, free() handles a null pointer argument transparently. This\r
+ // is not true of RuntimeFreeMem() below, so protect it.\r
+ //\r
+ if (ptr != NULL) {\r
+ RuntimeFreeMem (ptr);\r
+ }\r
}\r