Re: [PATCH RESEND v12 1/6] Define SGX capabilities structs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/18/22 09:59, Haibin Huang wrote:
> Signed-off-by: Haibin Huang <haibin.huang@xxxxxxxxx>
> ---
>  src/conf/domain_capabilities.c | 10 ++++++++++
>  src/conf/domain_capabilities.h | 13 +++++++++++++
>  src/libvirt_private.syms       |  1 +
>  3 files changed, 24 insertions(+)
> 
> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
> index 2a888da1a9..d0e863c5cb 100644
> --- a/src/conf/domain_capabilities.c
> +++ b/src/conf/domain_capabilities.c
> @@ -78,6 +78,16 @@ virSEVCapabilitiesFree(virSEVCapability *cap)
>  }
>  
>  
> +void
> +virSGXCapabilitiesFree(virSGXCapability *cap)
> +{
> +    if (!cap)
> +        return;
> +
> +    VIR_FREE(cap);

We try to avoid VIR_FREE() in new code. Either use plain g_free() or if
you also need to clear the pointer then: g_clear_pointer(&cap, g_free);
but since only first order pointer is passed then clearing the variable
has no visible effect outside of the function => plain g_free() is
sufficient.

> +}
> +
> +

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux