mirror of https://gitee.com/openkylin/qemu.git
nvdimm: fix memory leak in error code path
object_get_canonical_path_component() returns a heap-allocated string that must be freed using g_free(). Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
5d3217340a
commit
cdcab9d941
|
@ -98,6 +98,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
|
|||
"small to contain nvdimm label (0x%" PRIx64 ") and "
|
||||
"aligned PMEM (0x%" PRIx64 ")",
|
||||
path, memory_region_size(mr), nvdimm->label_size, align);
|
||||
g_free(path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue