Fix coverity memory leak issue #11145 as part of EUCA-4798.
Fix coverity memory leak issue #11144 as part of EUCA-4798.