Fix issue with valgrind reporting invaid free()
EUCA-6166