Prova ad aggiungere il cast alla malloc (struct elemento*) , e ad inserire return p .