From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv5By-0004vZ-Tv for qemu-devel@nongnu.org; Fri, 14 Oct 2016 12:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bv5Bu-0006QO-P4 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 12:18:42 -0400 Received: from mo179.mail-out.ovh.net ([178.32.228.179]:36083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv5Bu-0006Py-JK for qemu-devel@nongnu.org; Fri, 14 Oct 2016 12:18:38 -0400 Received: from player792.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id B90A3FFAB0B for ; Fri, 14 Oct 2016 18:18:37 +0200 (CEST) Date: Fri, 14 Oct 2016 18:18:32 +0200 From: Greg Kurz Message-ID: <20161014181832.183740e1@bahia> In-Reply-To: <1476435535-9408-2-git-send-email-lvivier@redhat.com> References: <1476435535-9408-1-git-send-email-lvivier@redhat.com> <1476435535-9408-2-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/6] tests: fix memory leak in virtio-scsi-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org, dgibson@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org On Fri, 14 Oct 2016 10:58:50 +0200 Laurent Vivier wrote: > vs is allocated in qvirtio_scsi_pci_init() and never freed. > > Signed-off-by: Laurent Vivier > --- Reviewed-by: Greg Kurz > tests/virtio-scsi-test.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c > index 79088bb..94d75b1 100644 > --- a/tests/virtio-scsi-test.c > +++ b/tests/virtio-scsi-test.c > @@ -64,6 +64,7 @@ static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs) > qvirtio_pci_device_disable(container_of(vs->dev, QVirtioPCIDevice, vdev)); > g_free(vs->dev); > qpci_free_pc(vs->bus); > + g_free(vs); > } > > static uint64_t qvirtio_scsi_alloc(QVirtIOSCSI *vs, size_t alloc_size,