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

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



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 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. */
--
1.7.0.233.g05e1a


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