From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPZA1-0002LI-8j for qemu-devel@nongnu.org; Tue, 19 Jul 2016 13:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPZ9z-0000j4-CT for qemu-devel@nongnu.org; Tue, 19 Jul 2016 13:50:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPZ9z-0000j0-6c for qemu-devel@nongnu.org; Tue, 19 Jul 2016 13:50:23 -0400 Date: Tue, 19 Jul 2016 20:50:17 +0300 From: "Michael S. Tsirkin" Message-ID: <20160719175017.GA32600@redhat.com> References: <1468950176-31959-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468950176-31959-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 01/55] nvdimm: fix memory leak in error code path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi , Paolo Bonzini , Igor Mammedov , Xiao Guangrong From: Stefan Hajnoczi object_get_canonical_path_component() returns a heap-allocated string that must be freed using g_free(). Reported-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi Reviewed-by: Igor Mammedov Reviewed-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/mem/nvdimm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 81896c0..7895805 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; } -- MST