From nobody Tue Feb 10 17:08:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501079901414170.34501882062705; Wed, 26 Jul 2017 07:38:21 -0700 (PDT) Received: from localhost ([::1]:38538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daNS4-0004M6-Tr for importer@patchew.org; Wed, 26 Jul 2017 10:38:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daNQK-0003Kf-GS for qemu-devel@nongnu.org; Wed, 26 Jul 2017 10:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daNQJ-0002AZ-JP for qemu-devel@nongnu.org; Wed, 26 Jul 2017 10:36:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1daNQJ-00029l-Di for qemu-devel@nongnu.org; Wed, 26 Jul 2017 10:36:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 433911E2F3; Wed, 26 Jul 2017 14:36:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-204-88.brq.redhat.com [10.40.204.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23F80779EA; Wed, 26 Jul 2017 14:36:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 433911E2F3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ldoktor@redhat.com From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= To: qemu-devel@nongnu.org Date: Wed, 26 Jul 2017 16:35:31 +0200 Message-Id: <20170726143543.2530-3-ldoktor@redhat.com> In-Reply-To: <20170726143543.2530-1-ldoktor@redhat.com> References: <20170726143543.2530-1-ldoktor@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Jul 2017 14:36:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 02/14] qcow2-bitmap: fix bitmap_free X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ldoktor@redhat.com, Vladimir Sementsov-Ogievskiy , famz@redhat.com, ehabkost@redhat.com, apahim@redhat.com, f4bug@amsat.org, armbru@redhat.com, mreitz@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Fix possible crash on error path in qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in 88ddffae8fc the bug was introduced later in commit 469c71edc72 (when qcow2_remove_persistent_dirty_bitmap was added). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-id: 20170714123341.373857-1-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/qcow2-bitmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 3e8735a..e8d3bdb 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -487,6 +487,10 @@ static inline void bitmap_directory_to_be(uint8_t *dir= , size_t size) =20 static void bitmap_free(Qcow2Bitmap *bm) { + if (bm =3D=3D NULL) { + return; + } + g_free(bm->name); g_free(bm); } --=20 2.9.4