diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-06-28 10:06:46 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-07-20 19:30:26 +0300 |
commit | cdcab9d94101a6dd9ac8136c6f2cd15b6a997896 (patch) | |
tree | f2b0a8d677eaf606f17d068bdbbf50d2e0172a1a /hw/mem | |
parent | 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d (diff) |
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>
Diffstat (limited to 'hw/mem')
-rw-r--r-- | hw/mem/nvdimm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 81896c0e84..7895805a23 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -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; } |