Re: [PATCH v1 06/31] virNetworkObjListFree: Accept NULL

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

 



On Thu, Feb 26, 2015 at 15:17:15 +0100, Michal Privoznik wrote:
> All of our vir*Free() functions should accept NULL, even though
> that there's no way of actually passing NULL with current code.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/conf/network_conf.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
> index 154a9bc..9734a7f 100644
> --- a/src/conf/network_conf.c
> +++ b/src/conf/network_conf.c
> @@ -279,6 +279,9 @@ void virNetworkObjListFree(virNetworkObjListPtr nets)
>  {
>      size_t i;
>  
> +    if (!nets)
> +        return;
> +
>      for (i = 0; i < nets->count; i++)
>          virNetworkObjFree(nets->objs[i]);

Since the function does not free @nets at the end it should really be
called virNetworkObjListClear. But that was present previously too.

ACK as is.

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]