]> xenbits.xensource.com Git - libvirt.git/commit
libxl_migration: Resolve Coverity RESOURCE_LEAK
authorJohn Ferlan <jferlan@redhat.com>
Wed, 27 Aug 2014 19:22:33 +0000 (15:22 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 28 Aug 2014 12:12:16 +0000 (08:12 -0400)
commitad4966d91a0dafc7667254fbe4ac56b7593644f6
tree6d4e071ae25b46b50e138337367cd985f970985f
parent2a4e26bdc1d03d20944c0bd00edd362aefff4877
libxl_migration: Resolve Coverity RESOURCE_LEAK

In libxlDomainMigrationPrepare() if the uri_in is false, then
'hostname' is allocated and used "generically" in the routine,
but not freed.  Conversely, if uri_in is true, then a uri is
allocated and hostname is set to the uri->hostname value and
likewise generically used.

At function exit, hostname wasn't free'd in the !uri_in path,
so that was added.  To just make it clearer on usage the else
path became the call to virURIFree() although I suppose technically
it didn't have to since it would be a call using (NULL)
src/libxl/libxl_migration.c