Used correct data type in malloc