do propery release of allocated memory for config