free dynamically allocated sample buffer when config changes