Fixed typo to use free instead of delete on malloc memory.