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

Daniel Veillard veillard at redhat.com
Fri Feb 19 10:46:48 UTC 2010


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 at redhat.com>
> 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 at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list