From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPHFL-0003Jx-8j for qemu-devel@nongnu.org; Mon, 18 Jul 2016 18:42:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPHFJ-0005IP-Je for qemu-devel@nongnu.org; Mon, 18 Jul 2016 18:42:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPHFJ-0005IL-EO for qemu-devel@nongnu.org; Mon, 18 Jul 2016 18:42:41 -0400 Date: Tue, 19 Jul 2016 01:42:36 +0300 From: "Michael S. Tsirkin" Message-ID: <20160719014236-mutt-send-email-mst@redhat.com> References: <1468881010-27229-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468881010-27229-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 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