Commit id '
f9edcfa4' added cookie manipulation for libxl; however, some
cookie crumb cleanup was missed. Found by Coverity.
In libxlDomainMigrationBegin, the cookie is allocated and baked; however,
the mig ingredients weren't cleaned up.
In libxlDomainMigrationPrepare, when the 'mig' cookie is added to the
args, set the 'mig = NULL'; otherwise, other failure paths between when
the code ate the cookie data and when it was added to args would fail
to clean up the crumbs.
Signed-off-by: John Ferlan <jferlan@redhat.com>
{
libxlDriverPrivatePtr driver = conn->privateData;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
- libxlMigrationCookiePtr mig;
+ libxlMigrationCookiePtr mig = NULL;
virDomainDefPtr tmpdef = NULL;
virDomainDefPtr def;
char *xml = NULL;
vm = NULL;
cleanup:
+ libxlMigrationCookieFree(mig);
if (vm)
virObjectUnlock(vm);
args->socks = socks;
args->nsocks = nsocks;
args->migcookie = mig;
+ mig = NULL;
for (i = 0; i < nsocks; i++) {
if (virNetSocketSetBlocking(socks[i], true) < 0)
}
done:
+ libxlMigrationCookieFree(mig);
if (!uri_in)
VIR_FREE(hostname);
else