Re: [libvirt PATCH 37/38] virStoragePoolObjListNew: `virHashNew` cannot return NULL

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

 



On Thu, Jul 22, 2021 at 09:50:29 +0200, Tim Wiederhake wrote:
> Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
> ---
>  src/conf/virstorageobj.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
> index 24957d6012..6c8a06e8bc 100644
> --- a/src/conf/virstorageobj.c
> +++ b/src/conf/virstorageobj.c
> @@ -401,12 +401,8 @@ virStoragePoolObjListNew(void)
>      if (!(pools = virObjectRWLockableNew(virStoragePoolObjListClass)))
>          return NULL;
>  
> -    if (!(pools->objs = virHashNew(virObjectFreeHashData)) ||
> -        !(pools->objsName = virHashNew(virObjectFreeHashData))) {
> -        virObjectUnref(pools);
> -        return NULL;
> -    }
> -
> +    pools->objs = virHashNew(virObjectFreeHashData);
> +    pools->objsName = virHashNew(virObjectFreeHashData);

Preferrably keep the newline before 'return'.

>      return pools;
>  }
>  
> -- 
> 2.31.1
> 




[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