Correct alloc free potentials errors in tests
The objective of this MR is to correct a pattern in test which can explain an observed memory corruption.
The objective of this MR is to correct a pattern in test which can explain an observed memory corruption.