]> Git Repo - qemu.git/commitdiff
nvdimm: fix memory leak in error code path
authorStefan Hajnoczi <[email protected]>
Tue, 28 Jun 2016 09:06:46 +0000 (10:06 +0100)
committerMichael S. Tsirkin <[email protected]>
Wed, 20 Jul 2016 16:30:26 +0000 (19:30 +0300)
object_get_canonical_path_component() returns a heap-allocated string
that must be freed using g_free().

Reported-by: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Reviewed-by: Xiao Guangrong <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/mem/nvdimm.c

index 81896c0e84783b9062ff553a534738dc66e7866e..7895805a23e6c0ec7e06e2c0aacc06fe98c31878 100644 (file)
@@ -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;
     }
 
This page took 0.026335 seconds and 4 git commands to generate.