From nobody Mon Feb 9 15:09:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576614634; cv=none; d=zohomail.com; s=zohoarc; b=DP2GBkGAd2lWukzpAipsvAxuNxisVLsR8TbHygFQENVBni9ml5xoMgNNuOTHNj+AS+0so4a3Eg9gG2yziUrn+JzlGWB3uZqqjvFdLXW7w/+ehg9CdwAtsFLvwAm+7jdf1mgcV0gm3Pu96VwDAaFo2RNt9tUqDcyoOzC3hiFKtFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576614634; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JjUxy+/4DMfUQfz9Safm+mKVuAjVe+59XuuulgqiVWk=; b=i0wtVGJ8/WPwHhy8iDCSW+Zk6g7RPpX1rB2CZyWuUNAli6zQq87fvdrPlOAXpCCvv9LfOtLttHdUGIg7BtHnfENYgcn92iYheC+D7gK2ZGRokPJpPJk11Qlxnwxn6TgzQkIfj48/Qbg2RhMbvihhF+1QFf+ZKwF0W1qPZoCCj9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576614634677893.4293737821479; Tue, 17 Dec 2019 12:30:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-2OuC-_n2OFq9EFxNiqJENw-1; Tue, 17 Dec 2019 15:30:31 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D118764A87; Tue, 17 Dec 2019 20:30:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C225F100032E; Tue, 17 Dec 2019 20:30:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B5760104905; Tue, 17 Dec 2019 20:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBHKUMKp005814 for ; Tue, 17 Dec 2019 15:30:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 708795D9E2; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.com (ovpn-116-68.phx2.redhat.com [10.3.116.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F45A5D9E1 for ; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576614633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JjUxy+/4DMfUQfz9Safm+mKVuAjVe+59XuuulgqiVWk=; b=WOGswSQz4Ve50HJbZkPddAy4bvWe/e8S76mkteoFEgDe91hQFTqjvQt3xV2mhPKMzYAPPR eO1Y42wp+lRDKLtZbPrmTJYq/7wFYtvUB6V5DEsenxbq4N0L0Iis8CtGiC1NEGlb/w2Maw EFnW4yCufBd5le2tq7UKpF0fGKu0gcI= From: John Ferlan To: libvir-list@redhat.com Date: Tue, 17 Dec 2019 15:30:03 -0500 Message-Id: <20191217203004.1279575-3-jferlan@redhat.com> In-Reply-To: <20191217203004.1279575-1-jferlan@redhat.com> References: <20191217203004.1279575-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] vbox: Reset @ret after xmlFreeNode X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 2OuC-_n2OFq9EFxNiqJENw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the error path, if we xmlFreeNode @ret, then the return ret; a few lines later returns something that's already been free'd and could be reused, so let's reinit it. Found by Coverity Signed-off-by: John Ferlan --- src/vbox/vbox_snapshot_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 5a0abd6d0e..db6c389a64 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotCo= nfHardDiskPtr hardDisk) if (result < 0) { xmlUnlinkNode(ret); xmlFreeNode(ret); + ret =3D NULL; } VIR_FREE(uuid); return ret; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list