c sample for malloc/free