From nobody Sun Feb 8 18:10:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1583771013; cv=none; d=zohomail.com; s=zohoarc; b=XQ1+746PC9F5YpcuXWYf9Tq/LBei3th9bsRATIHOPb19wEI5/TLquAJuvp2f+KFoDfOv26ajd0bhlHGtqD/p6Z9SRgHAUANiQTwdJc4MmBZUSNGCONRAMT4byWauXDtyzaQDME50n55cmM6s/8WEBc/CD6kNq7UPgP5rH3Xp+6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583771013; 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=fN7qjQmisLr0Zoi96GtSBnpJIPQSyg5K3yzGsMhVQRI=; b=cViUJ5c/GfiT3cFrnzLv38cFHnkDflhaclRS00C6iX4fTHEdkW4+DB1ojQDvaoej0ytCJREE9PZWv28L15vLj/IsWaXQg/cYGi/U6ycnPfXghKf9NQtJFGiIYkJmHI9M6XHMVxzJP2ZKFXvt/xEoNFYSnBiSRD7pJjucey0KkyQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583771013060993.6117270432982; Mon, 9 Mar 2020 09:23:33 -0700 (PDT) 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-1-5Z1eTgnzPiGVAl9W6rgnzA-1; Mon, 09 Mar 2020 12:23: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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5DBFE800D5C; Mon, 9 Mar 2020 16:23:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 848915D9C5; Mon, 9 Mar 2020 16:23:20 +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 E27F018089CF; Mon, 9 Mar 2020 16:23:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 029GNHcm020693 for ; Mon, 9 Mar 2020 12:23:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C28990779; Mon, 9 Mar 2020 16:23:17 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A64B89051C for ; Mon, 9 Mar 2020 16:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583771011; 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=fN7qjQmisLr0Zoi96GtSBnpJIPQSyg5K3yzGsMhVQRI=; b=QirCh6gIQA0GUqc6jDKxi1750Zr9hwEn/wpF2DlSrFCwZaD3Qy8jlnrvLGeF4dcc/gu5Z1 AtPtRljSSBHXupzb//66tzEHHy/ryS2Rp8PSj8ukXACB2iuNMt9PQk+jrqYCZlNNrKzzxv lWOdwTLXaTDRzV9efq2qBPhOrU9ujJY= X-MC-Unique: 5Z1eTgnzPiGVAl9W6rgnzA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/30] qemuMigrationParamsResetTLS: Adapt to modern memory management Date: Mon, 9 Mar 2020 17:22:43 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use g_autofree instead of VIR_FREE and delete the comment mentioning possible failure to allocate memory. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration_params.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index a36c6a4aea..8c552ab9a0 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -1070,8 +1070,8 @@ qemuMigrationParamsResetTLS(virQEMUDriverPtr driver, qemuMigrationParamsPtr origParams, unsigned long apiFlags) { - char *tlsAlias =3D NULL; - char *secAlias =3D NULL; + g_autofree char *tlsAlias =3D NULL; + g_autofree char *secAlias =3D NULL; /* There's nothing to do if QEMU does not support TLS migration or we = were * not asked to enable it. */ @@ -1079,17 +1079,11 @@ qemuMigrationParamsResetTLS(virQEMUDriverPtr driver, !(apiFlags & VIR_MIGRATE_TLS)) return; - /* NB: If either or both fail to allocate memory we can still proceed - * since the next time we migrate another deletion attempt will be - * made after successfully generating the aliases. */ tlsAlias =3D qemuAliasTLSObjFromSrcAlias(QEMU_MIGRATION_TLS_ALIAS_BASE= ); secAlias =3D qemuDomainGetSecretAESAlias(QEMU_MIGRATION_TLS_ALIAS_BASE= , false); qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias); g_clear_pointer(&QEMU_DOMAIN_PRIVATE(vm)->migSecinfo, qemuDomainSecret= InfoFree); - - VIR_FREE(tlsAlias); - VIR_FREE(secAlias); } --=20 2.24.1