From nobody Sat May 18 12:47:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1673347285; cv=none; d=zohomail.com; s=zohoarc; b=ERL4OvFgp4x/lK8ZmU92G5FshJQN75bdMoHKA4QZ9AASrPh6BR2Lpw+iIecAXV0vxOTPmuXUsY/opyF7nu1HiC0hu+bYrncziruWIwBgUcBB2VvyIKa1QpPDn9lHDOr1+0ZRG5MW0ui3Bt2bDQ0/VoyAvrKix/oyKtq3nJk3l1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673347285; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=/EixR1s8YdORLTKOqVdJoqfZSwZIDacrB+6afxEh2I0=; b=QYez+iUzhGIQyjQgnCRaAysHKPvhpUy5cw0URklV537zeNOhm/kr44MpY4FOsfc7fmXMDRUtavdZYOT5XwTQJ3afGjJ/6yo8dQjJ2TYwRGAG9kxKcgGGaI8qg/yhcshYErQPDHj0Ybr7rgG7vf+GteJkrla4bIgHbK36tA83gMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1673347285653602.9020893888836; Tue, 10 Jan 2023 02:41:25 -0800 (PST) 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-622-tWvVs3chNsm7YTYwMwBJbw-1; Tue, 10 Jan 2023 05:41:19 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64440196EF8D; Tue, 10 Jan 2023 10:41:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A5081121314; Tue, 10 Jan 2023 10:41:17 +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 C2EFB193F511; Tue, 10 Jan 2023 10:41:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C6EC81946587 for ; Tue, 10 Jan 2023 10:41:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A4620C16033; Tue, 10 Jan 2023 10:41:05 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AB12C16032; Tue, 10 Jan 2023 10:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673347284; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/EixR1s8YdORLTKOqVdJoqfZSwZIDacrB+6afxEh2I0=; b=UFLJ7rBIn8ablZoX59jJ2USihgeZWkzCJZuOAHZWU4OMcdQg+tlC1/H6d4pC4FPTT7tldh R41pP2tdcaJr8RsUyr3WV0Y10roxkCbzmujXdpZVaDDl77fbGqWqRHHhoMag3MqjXQ/E7z evwKPJ7kufem1qwtb7CPMkUJ+zHAUjM= X-MC-Unique: tWvVs3chNsm7YTYwMwBJbw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] admin: fix leak of typed parameters on error Date: Tue, 10 Jan 2023 05:41:03 -0500 Message-Id: <20230110104103.2399983-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673347286224100001 A few admin client methods had the xdr_free call the wrong side of the cleanup label, so typed parameters would not be freed on error. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/admin/admin_remote.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c index 012488bff3..f99b93eef6 100644 --- a/src/admin/admin_remote.c +++ b/src/admin/admin_remote.c @@ -269,9 +269,9 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPt= r srv, goto cleanup; =20 rv =3D 0; - xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (c= har *) &ret); =20 cleanup: + xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (c= har *) &ret); virObjectUnlock(priv); return rv; } @@ -342,9 +342,9 @@ remoteAdminClientGetInfo(virAdmClientPtr client, goto cleanup; =20 rv =3D 0; - xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret); =20 cleanup: + xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret); virObjectUnlock(priv); return rv; } @@ -380,10 +380,10 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv, goto cleanup; =20 rv =3D 0; - xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret, - (char *) &ret); =20 cleanup: + xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret, + (char *) &ret); virObjectUnlock(priv); return rv; } --=20 2.38.1