From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRROx-0003QB-J2 for qemu-devel@nongnu.org; Fri, 18 Nov 2011 11:34:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRROw-0002NQ-Kh for qemu-devel@nongnu.org; Fri, 18 Nov 2011 11:34:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRROw-0002NA-CG for qemu-devel@nongnu.org; Fri, 18 Nov 2011 11:34:54 -0500 Message-ID: <4EC689E8.40505@redhat.com> Date: Fri, 18 Nov 2011 17:38:00 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1321542834-6880-1-git-send-email-kwolf@redhat.com> <1321542834-6880-7-git-send-email-kwolf@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] qcow2: Fix order of refcount updates in qcow2_snapshot_goto List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Am 18.11.2011 17:28, schrieb Stefan Hajnoczi: > On Thu, Nov 17, 2011 at 3:13 PM, Kevin Wolf wrote: >> - /* FIXME This is too late! */ >> - ret = qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, 1); >> + if (ret < 0) { >> + goto fail; >> + } >> + >> + g_free(sn_l1_table); > > Prevent double-free if qcow2_update_snapshot_refcount() fails below: > > sn_l1_table = NULL; Thanks, good catch. Fixed this locally. Kevin