Error with malloc fixed