fix mem leak in test

Change-Id: Ic29c0d477d9960520385408bd783f822d8116448
Merge topic 'fix-valgrind-leak' into master

71ac5541 fix mem leak in test