mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Fix resource leak in qemuDomainAddChardevTLSObjects error path
On any failure, call virJSONValueFree for the *Props. Signed-off-by: John Ferlan <jferlan@redhat.com> (cherry picked from commit 2e8c60958ac32624296eee263bf34bb21a32360c)
This commit is contained in:
parent
8eeeb7651f
commit
3056195621
@ -213,7 +213,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver,
|
|||||||
cfg->migrateTLSx509verify,
|
cfg->migrateTLSx509verify,
|
||||||
QEMU_MIGRATION_TLS_ALIAS_BASE,
|
QEMU_MIGRATION_TLS_ALIAS_BASE,
|
||||||
&tlsProps, tlsAlias, &secProps, secAlias) < 0)
|
&tlsProps, tlsAlias, &secProps, secAlias) < 0)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
/* Ensure the domain doesn't already have the TLS objects defined...
|
/* Ensure the domain doesn't already have the TLS objects defined...
|
||||||
* This should prevent any issues just in case some cleanup wasn't
|
* This should prevent any issues just in case some cleanup wasn't
|
||||||
@ -223,12 +223,17 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
if (qemuDomainAddTLSObjects(driver, vm, asyncJob, *secAlias, &secProps,
|
if (qemuDomainAddTLSObjects(driver, vm, asyncJob, *secAlias, &secProps,
|
||||||
*tlsAlias, &tlsProps) < 0)
|
*tlsAlias, &tlsProps) < 0)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0)
|
if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
virJSONValueFree(tlsProps);
|
||||||
|
virJSONValueFree(secProps);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user