Yes, you are right.
I was more thinking on all these helping variables, where you allocate memory and then you need to free the allocated memory.
And I didn't read carefully, my bad, the allocated memory was for the returned restriction string. Then yes, it must not be freed!
sorry for the confusion...