From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b56nu-00061W-9P for qemu-devel@nongnu.org; Tue, 24 May 2016 03:31:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b56nq-0007QE-3n for qemu-devel@nongnu.org; Tue, 24 May 2016 03:31:01 -0400 Date: Tue, 24 May 2016 09:30:44 +0200 From: Kevin Wolf Message-ID: <20160524073044.GA7091@noname.redhat.com> References: <1463764652-11290-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463764652-11290-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3] block: Fix bdrv_next() memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: pbonzini@redhat.com, qemu-devel@nongnu.org Am 20.05.2016 um 19:17 hat Kevin Wolf geschrieben: > The bdrv_next() users all leaked the BdrvNextIterator after completing > the iteration. Simply changing bdrv_next() to free the iterator before > returning NULL at the end of list doesn't work because some callers exit > the loop before looking at all BDSes. > > This patch moves the BdrvNextIterator from the heap to the stack of > the caller and switches to a bdrv_first()/bdrv_next() interface for > initialising the iterator. > > Signed-off-by: Kevin Wolf Applied to the block branch. Kevin