Recode safeMalloc and retest to verify header and footer content