From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHp2v-0001OP-3h for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:11:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHp2p-0005Ks-3S for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:11:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHp2o-0005Km-Tw for qemu-devel@nongnu.org; Tue, 28 Jun 2016 05:10:59 -0400 Date: Tue, 28 Jun 2016 11:10:56 +0200 From: Igor Mammedov Message-ID: <20160628111056.1e99ac9c@nial.brq.redhat.com> In-Reply-To: <1467104806-3461-1-git-send-email-stefanha@redhat.com> References: <1467104806-3461-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Paolo Bonzini , Xiao Guangrong , "Michael S. Tsirkin" On Tue, 28 Jun 2016 10:06:46 +0100 Stefan Hajnoczi wrote: > 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 > --- > 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; > } >