From nobody Fri Apr 26 16:11:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1610027702; cv=none; d=zohomail.com; s=zohoarc; b=ZNC5r0EGik/1pt62cFUu8Intodux4LuHujepRNHDQvOGjidYzubUhHjCEWTgxV1LqcO0aD0qGPrSVMbVRGW/3JDvv54FWCCexN/myAae1ZHV3a/5XFzu259QCrmjz6aTWUS7pNUHb8O+lVgFOpHvRZ/vJCGo6rQOHfcwKRdFWdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610027702; h=Content-Type:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=KN53SL9ZzLp67ywE67CgbVe72TOs3fYMD3kos1uHsU4=; b=aON+UtmKi/MP2GjqztBTEShnrqiMrp8KQpr2KzjY5aaZatqO7Dob6MD/ocaLsMjYbJftS7XEySQFNPjwzuAq3MrGMTyM+jPazPGV69MkmEyya1Cla7jW0SBLigDw1nxE+MRiLgfCFMfS5LyxLAfqRQiiIQi5LNic/sTrz8F6bh4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610027702741223.4704526523409; Thu, 7 Jan 2021 05:55:02 -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-101-BQ9C5G87O-eJhsGlDGi4LQ-1; Thu, 07 Jan 2021 08:54:59 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB841107ACE3; Thu, 7 Jan 2021 13:54:47 +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 9DC7519C48; Thu, 7 Jan 2021 13:54:47 +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 57E234BB7B; Thu, 7 Jan 2021 13:54:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 107DsijE029748 for ; Thu, 7 Jan 2021 08:54:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 136462166B28; Thu, 7 Jan 2021 13:54:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F12B2166B2D for ; Thu, 7 Jan 2021 13:54:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DBE8F101A561 for ; Thu, 7 Jan 2021 13:54:38 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-s1pJzKowM46WO2N1gkxo7Q-1; Thu, 07 Jan 2021 08:54:36 -0500 Received: from [10.28.15.168] (helo=vz7.sw.ru.) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from ) id 1kxVjJ-00FjB8-Ui for libvir-list@redhat.com; Thu, 07 Jan 2021 16:53:34 +0300 X-MC-Unique: BQ9C5G87O-eJhsGlDGi4LQ-1 X-MC-Unique: s1pJzKowM46WO2N1gkxo7Q-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH] src: fix resource leak introduced in d4439a6b8 Date: Thu, 7 Jan 2021 16:53:34 +0300 Message-Id: <1610027614-715743-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" @tmp that was copied just above is leaked on plain return. The issue is found by Coverity. Patch that inroduced a leak: d4439a6b8 : src: adopt to VIR_DRV_SUPPORTS_FEATURE return -1 Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel P. Berrang=C3=A9 --- src/libvirt-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 2f9081a..c9f8ffd 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3022,7 +3022,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, ret =3D VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTI= ON); if (ret < 0) - return NULL; + goto done; if (ret) protection =3D VIR_MIGRATE_CHANGE_PROTECTION; =20 --=20 1.8.3.1