diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7c79c324e64bc1aed9a0141f1352df3be720c039..42069ee6174a3c79c4f49b76f2a9154e1ab532a8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; }