nvdimm: fix memory leak in error code path
commitcdcab9d94101a6dd9ac8136c6f2cd15b6a997896
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 28 Jun 2016 09:06:46 +0000 (28 10:06 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 20 Jul 2016 16:30:26 +0000 (20 19:30 +0300)
treef2b0a8d677eaf606f17d068bdbbf50d2e0172a1a
parent5d3217340adcb6c4f0e4af5d2b865331eb2ff63d
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>
hw/mem/nvdimm.c