moved a free in regex parser inside the code-block where memory for it is allocated