Re: [PATCH] network: Resolve Coverity FORWARD_NULL

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

 



On Fri, Jan 16, 2015 at 06:58:56AM -0500, John Ferlan wrote:
> Commit id 'ca481a6f' added virNetworkRouteDefFree which may be called
> in an error path from lxcAddNetworkRouteDefinition with 'route = NULL'.
> So just add the (!def) at the top to resolve.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/conf/networkcommon_conf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c
> index 3f0896d..7b7a851 100644
> --- a/src/conf/networkcommon_conf.c
> +++ b/src/conf/networkcommon_conf.c
> @@ -52,6 +52,8 @@ struct _virNetworkRouteDef {
>  void
>  virNetworkRouteDefFree(virNetworkRouteDefPtr def)
>  {
> +    if (!def)
> +        return;
>      VIR_FREE(def->family);
>      VIR_FREE(def);
>  }

ACK


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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