From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHoyr-0004pa-4O for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:06:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHoym-0004Nm-So for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:06:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHoym-0004Ni-OD for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:06:48 -0400 From: Stefan Hajnoczi Date: Tue, 28 Jun 2016 10:06:46 +0100 Message-Id: <1467104806-3461-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH] 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: Paolo Bonzini , Xiao Guangrong , Igor Mammedov , "Michael S. Tsirkin" , 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 --- 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; } -- 2.7.4