fixed memory leak in core ds tests
fixed memory leak in core ds tests

(cherry picked from commit 7719da95526b81af0195a3576774eaac605cd045)

opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv