提交 2382a236 编写于 作者: J Ján Tomko

qemuDomainGetSEVMeasurement: fix possible leak

Free tmp even on failure.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NBrijesh Singh <brijesh.singh@amd.com>
Tested-by: NBrijesh Singh <brijesh.singh@amd.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 dfc56964
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册