Re: [libvirt] [PATCH] virsh: be careful to return "FALSE" upon OOM

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

 



On Thu, Feb 18, 2010 at 11:07:46AM +0100, Jim Meyering wrote:
> Clang reported this as a "dead store" to "ret".
> Here's one way to fix it.
> 
> Or just "return FALSE;" and remove the preceding assignment.
> 
> >From debb6f5198027a056aa24dca95ea4930184ad3fe Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@xxxxxxxxxx>
> Date: Thu, 18 Feb 2010 11:05:38 +0100
> Subject: [PATCH] virsh: be careful to return "FALSE" upon OOM
> 
> * tools/virsh.c (cmdCPUBaseline): Add an explicit "return" statement
> after the "no_memory:" label.
> ---
>  tools/virsh.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index e1d1300..dd916f3 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -7141,6 +7141,7 @@ cleanup:
>  no_memory:
>      vshError(ctl, "%s", _("Out of memory"));
>      ret = FALSE;
> +    return ret;
>  }
> 
>  /* Common code for the edit / net-edit / pool-edit functions which follow. */

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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