That's legal
They can hold you up to 30 days on warrant and if it's in another county or state that county that wants you must come out to get you or pay for travel expenses to get you into the county where the warrant was issued. If the warrant is only misdemeanor and not worth the cost of extraditing you they won't bother and the county that's holding you will release you because they will never pay to have you extradited to another county with their own money but the warrant will remain and it can happen again.
You need to take care of it where ever the warrant was issued. If you can't afford an attorney you can go see a public defender in the county that wants you and the public defender can schedule a court date so you can see a judge. If not serious you will be able to settle the matter. Or in most counties you can turn yourself into the court and it will be resolved the same day