Wives have a share in the inheritance, as long as they had a valid marriage to the husband at the time of his demise, or they are within the iddah period of a reconcilable divorce. Having children is not a condition for them being a heir.
If the husband had any descendants (regardless of who their mother is), then all the wives will receive 1/8 th of the estate, i.e. if there were two wives then each will get 1/16
فإن كان لكم ولد فلهن الثمن مما تركتم
But if you leave a child, then for them (wives) is an eighth of what you leave
أن يكون فرضها الثمن، وذلك إذا كان للزوج فرع وارث منها أو من غيرها
The wife's prescribed share is an eighth and this is when the husband has a child who is a heir, whether from her or some other wife