use of malloc instead of new