mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemuDomainGetSEVMeasurement: fix possible leak
Free tmp even on failure. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Brijesh Singh <brijesh.singh@amd.com> Tested-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
dfc5696492
commit
2382a23614
@ -21503,7 +21503,7 @@ qemuDomainGetSEVMeasurement(virQEMUDriverPtr driver,
|
||||
unsigned int flags)
|
||||
{
|
||||
int ret = -1;
|
||||
char *tmp;
|
||||
char *tmp = NULL;
|
||||
int maxpar = 0;
|
||||
|
||||
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
|
||||
@ -21526,10 +21526,10 @@ qemuDomainGetSEVMeasurement(virQEMUDriverPtr driver,
|
||||
tmp) < 0)
|
||||
goto endjob;
|
||||
|
||||
VIR_FREE(tmp);
|
||||
ret = 0;
|
||||
|
||||
endjob:
|
||||
VIR_FREE(tmp);
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user