From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgD83-0004CU-U7 for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgD7w-0007BF-3t for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgD7v-0007B9-Sv for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:00 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9KDZxch001221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 20 Oct 2014 09:35:59 -0400 From: Kevin Wolf Date: Mon, 20 Oct 2014 15:35:27 +0200 Message-Id: <1413812154-11153-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1413812154-11153-1-git-send-email-kwolf@redhat.com> References: <1413812154-11153-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 01/28] qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com From: Zhang Haoyu When the Qcow2DiscardRegion is adjacent to another one referenced by "d", free this Qcow2DiscardRegion metadata referenced by "p" after it was removed from s->discards queue. Signed-off-by: Zhang Haoyu Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2bcaaf9..c31d85a 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -524,6 +524,7 @@ found: QTAILQ_REMOVE(&s->discards, p, next); d->offset = MIN(d->offset, p->offset); d->bytes += p->bytes; + g_free(p); } } -- 1.8.3.1