From nobody Mon Feb 9 03:31:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1652793432; cv=none; d=zohomail.com; s=zohoarc; b=OOY55VZ5zp+ldReVb1AKauAY+dPCSuhBxA+TIu6iSXhd2ah94bP8cCCKgbs6hbBnSR6pk4g52APhMWRWpTUtTvKUM+6dR0jqA6kXYhVwV421i4Ym5LzIuw0lLvEsNiz88PwKRJ2S00GXmbZGFoBk7jU9UIlJdNX6KDcccFbIOCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652793432; 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=XOFmiB8kZCe7y6FhqOlDqg5/3OVJReA/4En8WMsDwBM=; b=oCV72H5bOMF7EZWDp5phxqFmNdU1h/A+8MotXbIEggRKBEG+OSh9xMVlDqjAjSfVmNCorIQCERwAjteGkMjAGosE29ioBxUDnSpivDV7D22RjpAfb7BmxJI78W7Dw6M+2HXhOtw5JGX4rkameqSTXbYhBjv4Favcu6Fh03aLEfQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652793432201464.6772313555957; Tue, 17 May 2022 06:17:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-LfX_7DTCOtGAVv49Qg1FhA-1; Tue, 17 May 2022 09:17:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA244803CB8; Tue, 17 May 2022 13:16:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5D59403151; Tue, 17 May 2022 13:16:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8B4611947072; Tue, 17 May 2022 13:16:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC4C81947056 for ; Tue, 17 May 2022 13:16:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9758E42D4F2; Tue, 17 May 2022 13:16:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1725542D4DB for ; Tue, 17 May 2022 13:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652793431; 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=XOFmiB8kZCe7y6FhqOlDqg5/3OVJReA/4En8WMsDwBM=; b=Bijk8WqIkJNZa2xdD6lHx70BKNr+Ul+ynaENlwLsTJ4a8OL1stkgc2VAVotyAWh7mcuYCt aaLyDXw7o08jNOXWp9r3P+XAPk65kzfcirL05qNOALvu71Hwe3xscMdZ8XyM9MmHXCQUwl D5amBqC6VxxirnRx4VGKK6vAl5I1/iU= X-MC-Unique: LfX_7DTCOtGAVv49Qg1FhA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/10] qemuMigrationSrcBegin: Automatically free 'xml' variable on error Date: Tue, 17 May 2022 15:16:38 +0200 Message-Id: <686c6c68f77b97adcbeac62881b37f777e6a4865.1652790229.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652793432796100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 25af291dc6..6b3815ac58 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2487,7 +2487,7 @@ qemuMigrationSrcBegin(virConnectPtr conn, { virQEMUDriver *driver =3D conn->privateData; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); - char *xml =3D NULL; + g_autofree char *xml =3D NULL; virDomainAsyncJob asyncJob; if (cfg->migrateTLSForce && @@ -2532,10 +2532,8 @@ qemuMigrationSrcBegin(virConnectPtr conn, * place. */ if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, - qemuMigrationSrcCleanup) < 0) { - VIR_FREE(xml); + qemuMigrationSrcCleanup) < 0) goto endjob; - } qemuMigrationJobContinue(vm); } else { goto endjob; @@ -2543,7 +2541,7 @@ qemuMigrationSrcBegin(virConnectPtr conn, cleanup: virDomainObjEndAPI(&vm); - return xml; + return g_steal_pointer(&xml); endjob: if (flags & VIR_MIGRATE_CHANGE_PROTECTION) --=20 2.35.3