Replace malloc/free with operator new/delete