Fixed memory errors in newly added tests

Change-Id: I9633903c5656791f7e4bbc79ce45c7f92d0a197c
Merge topic 'fix_valgrind_error' into master

3a27c8e6 Fixed memory errors in newly added tests