From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQGna-0000iX-L7 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQGnZ-0007qg-Ry for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:26:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQGnZ-0007qc-MB for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:26:09 -0400 Date: Thu, 21 Jul 2016 19:26:05 +0300 From: "Michael S. Tsirkin" Message-ID: <1469118288-4776-2-git-send-email-mst@redhat.com> References: <1469118288-4776-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469118288-4776-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v4 01/57] 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