From nobody Tue Feb 10 16:58:07 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=1612160887; cv=none; d=zohomail.com; s=zohoarc; b=Xj/TaBo5hp7z8ruTxHKwLtR0qbHA8l6QgHhO/bW1jQqe/pREIA/nZTE7exO66mvxccfQF7rz+P6Fxq8huPq0jmlxqcapaDa2A2ljUp/+GQlrduu3HRnAa/bmSJbdJn1KhFqprEA9aXzsz30D0SAiyFgwR/rbRGAsXLCcGDBCo8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612160887; 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=zu7hmENln2I5ClbLXJgfGtJxJYanMc7Er00Spevwy4k=; b=iZbnbcYSUqHsAi28F2hTBJcD1ZvY6KVqvFeGpeTfcq/okPq65ScxCZcx/CRtz3sI06tNtjxBVslCmMnucYA9R2GjCWjAILWBDyh7w3htOvAK01RR2SCvfiFQuLunPqQmJ3j+ZANYAz3qpdSp6R1UTJUPyRvET7t28T+P91ZH+Fo= 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 1612160887177819.4659863875045; Sun, 31 Jan 2021 22:28:07 -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-458-_VNrT0COPpuUc4HvDgB0yw-1; Mon, 01 Feb 2021 01:28:01 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F8071007460; Mon, 1 Feb 2021 06:27:54 +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 5FF806F988; Mon, 1 Feb 2021 06:27:54 +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 298F31809CA7; Mon, 1 Feb 2021 06:27:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1116RSkw026030 for ; Mon, 1 Feb 2021 01:27:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id BA91670497; Mon, 1 Feb 2021 06:27:28 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-159.phx2.redhat.com [10.3.112.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8545070476 for ; Mon, 1 Feb 2021 06:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612160886; 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=zu7hmENln2I5ClbLXJgfGtJxJYanMc7Er00Spevwy4k=; b=D6/FQaooFtSwHnb/zgUvNThOIUGRcOKSsi3n746BL50AL+oHTRlxOyH+vwd5DhYo2PHFTR dToEppKqK36UIUF97qYZQWD+7cfoolIompxtB8oMPYjctiTRK0Vs33P6U4Q16F+jnUuqu8 Yn+HqcuWuBAQBa/vXE6yWYr/Y9SKDbE= X-MC-Unique: _VNrT0COPpuUc4HvDgB0yw-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 7/8] util: rename virStorageEncryptionInfoDefFree() Date: Mon, 1 Feb 2021 01:27:19 -0500 Message-Id: <20210201062720.425041-8-laine@redhat.com> In-Reply-To: <20210201062720.425041-1-laine@redhat.com> References: <20210201062720.425041-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.13 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" usually a function call vir*Free() will take a single pointer to an object as its argument, and will then free all resources associated with that object, including the object itself. virStorageEnctyptionInfoDefFree() doesn't do that - it frees all the subordinate resources of the ojbect, but doesn't free the object itself; usually a function like that is called vir*Clear(). Let's rename this function to not be misleading. Signed-off-by: Laine Stump --- src/conf/storage_encryption_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encrypti= on_conf.c index 34ad5dffeb..6a32df15b7 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -48,7 +48,7 @@ VIR_ENUM_IMPL(virStorageEncryptionFormat, ); =20 static void -virStorageEncryptionInfoDefFree(virStorageEncryptionInfoDefPtr def) +virStorageEncryptionInfoDefClear(virStorageEncryptionInfoDefPtr def) { VIR_FREE(def->cipher_name); VIR_FREE(def->cipher_mode); @@ -77,7 +77,7 @@ virStorageEncryptionFree(virStorageEncryptionPtr enc) =20 for (i =3D 0; i < enc->nsecrets; i++) virStorageEncryptionSecretFree(enc->secrets[i]); - virStorageEncryptionInfoDefFree(&enc->encinfo); + virStorageEncryptionInfoDefClear(&enc->encinfo); VIR_FREE(enc->secrets); VIR_FREE(enc); } --=20 2.29.2