Re: [libvirt PATCH 3/4] tests: use g_new0 instead of VIR_ALLOC_N

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

 



On Wed, Sep 23, 2020 at 01:04:17 +0200, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
> ---

[...]

> diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c
> index ae4b08b9d8..fd746d1ca1 100644
> --- a/tests/securityselinuxtest.c
> +++ b/tests/securityselinuxtest.c
> @@ -71,8 +71,7 @@ testBuildDomainDef(bool dynamic,
>          goto error;
>  
>      def->virtType = VIR_DOMAIN_VIRT_KVM;
> -    if (VIR_ALLOC_N(def->seclabels, 1) < 0)
> -        goto error;
> +    def->seclabels = g_new0(char, 1);

'def' is virDomainDefPtr thus 'def->seclabels' is not char but 'virSecurityLabelDefPtr *'

The compiler didn't moan because it's a double pointer, but it certainly
doens't have enough size nor the correct type.

>  
>      if (VIR_ALLOC(secdef) < 0)
>          goto error;




[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