From nobody Tue Feb 10 12:45:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1612411118; cv=none; d=zohomail.com; s=zohoarc; b=ifOfblYDnGB+QMeEi5zelubCuyVFy2IBAvVZzZOTVxtjLfoVHxgmZWYZCHYkzzDhxJ76Ep5OsWvNBMM93OFDlBXHePrVHzcU7VxrwkWrYwWiWH4CO7709K4eR9uCzj6K5IeBs8N1jchPsExL0FIJZ4cp5sqvUuFqQyzmM80Dovw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612411118; 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=i0vIRyn+JKsbcMDRJKp6dVn1UrhM/uLUoFsmD9vC3P0=; b=WhacWJ8WEBUJzmDpPaQM04pMs9bj9S2u+0OlgH5nSPtM05sgEwNU5jtR8NGKmxJJb9kpmomm/6ed6FecWzHHyORVwHqex/9X0H9nS4jmJ7OcP5ZEUIUHKOD2KjtIV/Ex/c1hzg7ekuk+er18OHr1DqyJQ6XzyiBdVQLM1VEEIKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1612411118492954.5053346213425; Wed, 3 Feb 2021 19:58:38 -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-240-pNPA5KIDO5CmbvCbMakXMQ-1; Wed, 03 Feb 2021 22:58:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D7B58030B1; Thu, 4 Feb 2021 03:58:30 +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 EE50A71C95; Thu, 4 Feb 2021 03:58:29 +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 BB20258092; Thu, 4 Feb 2021 03:58:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1143wHc3003618 for ; Wed, 3 Feb 2021 22:58:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 820FA5B6AA; Thu, 4 Feb 2021 03:58:17 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-199.phx2.redhat.com [10.3.112.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00A345B697 for ; Thu, 4 Feb 2021 03:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612411117; 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=i0vIRyn+JKsbcMDRJKp6dVn1UrhM/uLUoFsmD9vC3P0=; b=Om/++sfalkSrCoZLYpDqAyf3U27mup8uj0UCMjgW6qqGVw2RF8LzRLu8IrTxJiLljG844E er9GHKwmmYOOn49vIsCf+gpq4kFynWCHKte+FGClz/2/3pO0mU5d1LTepYFISYIXxGb1K/ y9CnG61ZqDQ4VgREFVFq/+l8tEfFuoQ= X-MC-Unique: pNPA5KIDO5CmbvCbMakXMQ-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH v2 24/24] rpc: rename virNetSessionAuthMethodsFree to virNetSessionAuthMethodsClear Date: Wed, 3 Feb 2021 22:57:51 -0500 Message-Id: <20210204035751.164765-25-laine@redhat.com> In-Reply-To: <20210204035751.164765-1-laine@redhat.com> References: <20210204035751.164765-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.16 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) Content-Type: text/plain; charset="utf-8" This is another *Free() function that doesn't free the object it is passed. Instead it frees and clears some parts of the object. In this case, the function is actually called from two places, and one of them (virNetSSHSessionAuthReset) appears to be assuming that the pointers actually *will* be cleared. So the proper thing to do here (?) is to rename the function to virNetSSHSesionAuthMethodsClear(). (NB: virNetSSHSessionAuthReset is seemingly never called from anywhere. Is this one of those functions that actually *is* called by some strange MACRO invocation? Or it is truly one of those "written-but-never-used" functions that can be deleted? (if the latter is the case, then I would rather move the contents of virNetSessionAuthMethodsFree() into its only other caller, virNetSSHSessionDispose(), so that the VIR_FREEs could be replaced with g_free.) Signed-off-by: Laine Stump --- src/rpc/virnetsshsession.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index 4b56363fa0..5bfe311544 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -113,7 +113,7 @@ struct _virNetSSHSession { }; =20 static void -virNetSSHSessionAuthMethodsFree(virNetSSHSessionPtr sess) +virNetSSHSessionAuthMethodsClear(virNetSSHSessionPtr sess) { size_t i; =20 @@ -149,7 +149,7 @@ virNetSSHSessionDispose(void *obj) libssh2_session_free(sess->session); } =20 - virNetSSHSessionAuthMethodsFree(sess); + virNetSSHSessionAuthMethodsClear(sess); =20 VIR_FREE(sess->channelCommand); VIR_FREE(sess->hostname); @@ -971,7 +971,7 @@ void virNetSSHSessionAuthReset(virNetSSHSessionPtr sess) { virObjectLock(sess); - virNetSSHSessionAuthMethodsFree(sess); + virNetSSHSessionAuthMethodsClear(sess); virObjectUnlock(sess); } =20 --=20 2.29.2