From Old Galician-Portuguese erdeiro, inherited from Latin hērēditārius. Doublet of hereditário. By surface analysis, from herdar + -eiro.
Practice speaking and memorizing "herdeiro" and many other words and sentences in Portuguese.